Module: Picky::API::Tokenizer::Stemmer

Included in:
Tokenizer
Defined in:
lib/picky/api/tokenizer/stemmer.rb

Instance Method Summary collapse

Instance Method Details

#extract_stemmer(thing) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/picky/api/tokenizer/stemmer.rb', line 7

def extract_stemmer thing
  if thing.respond_to? :stem
    thing
  else
    raise ArgumentError.new <<-ERROR
The stems_with option needs a stemmer,
which responds to #stem(text) and returns stemmed_text."
ERROR
  end
end