Class: Ferret::Analysis::LetterAnalyzerWithStopFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/picolena/templates/config/initializers/001_load_ferret.rb

Overview

Used for alias_path queries

Instance Method Summary collapse

Constructor Details

#initialize(stop_words = FULL_ENGLISH_STOP_WORDS, lower = true) ⇒ LetterAnalyzerWithStopFilter

Returns a new instance of LetterAnalyzerWithStopFilter.



6
7
8
9
# File 'lib/picolena/templates/config/initializers/001_load_ferret.rb', line 6

def initialize(stop_words = FULL_ENGLISH_STOP_WORDS, lower = true)
 @lower = lower
 @stop_words = stop_words
end

Instance Method Details

#token_stream(field, str) ⇒ Object



11
12
13
14
# File 'lib/picolena/templates/config/initializers/001_load_ferret.rb', line 11

def token_stream(field, str)
  ts = LetterTokenizer.new(str, @lower)
  StopFilter.new(ts, @stop_words)
end