Class: MiniSearch::CompoundTokenizer
- Inherits:
-
Object
- Object
- MiniSearch::CompoundTokenizer
- Defined in:
- lib/mini_search/compound_tokenizer.rb
Instance Method Summary collapse
- #execute(string) ⇒ Object
-
#initialize(tokenizers) ⇒ CompoundTokenizer
constructor
A new instance of CompoundTokenizer.
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 |