module Stemmer

Constants

ALEF
GAF
HEH
MEEM
NOON
PLURAL_FORMS
REH
SUFFIXES
TET
YEH

Public Instance Methods

stem() click to toggle source
# File lib/stemmer.rb, line 28
def stem
  stem_suffix
  @word = word.strip
end

Private Instance Methods

stem_suffix() click to toggle source
# File lib/stemmer.rb, line 35
def stem_suffix
  filter_rules(SUFFIXES).each do |suffix|
    if word.end_with?(suffix)
      @word = word[0..-(suffix.length + 1)]
      break
    end
  end
end