Class: Kreuzberg::Config::KeywordRakeParams

Inherits:
Object
  • Object
show all
Defined in:
lib/kreuzberg/config.rb

Overview

RAKE keyword extraction parameters

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(min_word_length: 1, max_words_per_phrase: 3) ⇒ KeywordRakeParams

Returns a new instance of KeywordRakeParams.



677
678
679
680
# File 'lib/kreuzberg/config.rb', line 677

def initialize(min_word_length: 1, max_words_per_phrase: 3)
  @min_word_length = min_word_length.to_i
  @max_words_per_phrase = max_words_per_phrase.to_i
end

Instance Attribute Details

#max_words_per_phraseObject (readonly)

Returns the value of attribute max_words_per_phrase.



675
676
677
# File 'lib/kreuzberg/config.rb', line 675

def max_words_per_phrase
  @max_words_per_phrase
end

#min_word_lengthObject (readonly)

Returns the value of attribute min_word_length.



675
676
677
# File 'lib/kreuzberg/config.rb', line 675

def min_word_length
  @min_word_length
end

Instance Method Details

#to_hObject



682
683
684
685
686
687
# File 'lib/kreuzberg/config.rb', line 682

def to_h
  {
    min_word_length: @min_word_length,
    max_words_per_phrase: @max_words_per_phrase
  }
end