Class: UEAStemmer::NonExhaustiveEndingRule

Inherits:
EndingRule show all
Defined in:
lib/uea-stemmer/rule.rb

Instance Attribute Summary

Attributes inherited from EndingRule

#original_pattern

Attributes inherited from Rule

#pattern, #rule_num, #suffix_size

Instance Method Summary collapse

Methods inherited from EndingRule

#initialize

Methods inherited from Rule

#initialize

Methods included from StringHelpers

#ends_with?, #remove_suffix

Constructor Details

This class inherits a constructor from UEAStemmer::EndingRule

Instance Method Details

#handle(word) ⇒ Object



75
76
77
# File 'lib/uea-stemmer/rule.rb', line 75

def handle(word)
  super(word) if word != @original_pattern
end

#to_sObject



79
80
81
# File 'lib/uea-stemmer/rule.rb', line 79

def to_s
  "rule ##{@rule_num} (remove -#{@original_pattern[@original_pattern.size - @suffix_size, @suffix_size]} when the word ends in -#{@original_pattern} unless the word is #{@original_pattern})"
end