Class: MiniSearch::CompoundTokenizer

Inherits:
Object
  • Object
show all
Defined in:
lib/mini_search/compound_tokenizer.rb

Instance Method Summary collapse

Constructor Details

#initialize(tokenizers) ⇒ CompoundTokenizer

Returns a new instance of CompoundTokenizer.



5
6
7
# File 'lib/mini_search/compound_tokenizer.rb', line 5

def initialize(tokenizers)
  @tokenizers = tokenizers
end

Instance Method Details

#execute(string) ⇒ Object



9
10
11
12
13
# File 'lib/mini_search/compound_tokenizer.rb', line 9

def execute(string)
  @tokenizers.each_with_object([]) do |tokenizer, tokens|
    tokens.concat(tokenizer.execute(string))
  end
end