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.



681
682
683
684
# File 'lib/kreuzberg/config.rb', line 681

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.



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

def max_words_per_phrase
  @max_words_per_phrase
end

#min_word_lengthObject (readonly)

Returns the value of attribute min_word_length.



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

def min_word_length
  @min_word_length
end

Instance Method Details

#to_hObject



686
687
688
689
690
691
# File 'lib/kreuzberg/config.rb', line 686

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