Class: UEAStemmer::EndingRule
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Rule
#pattern, #rule_num, #suffix_size
Instance Method Summary collapse
Methods inherited from Rule
Methods included from StringHelpers
Constructor Details
This class inherits a constructor from UEAStemmer::Rule
Instance Method Details
#handle(word) ⇒ Object
45 46 47 |
# File 'lib/rule.rb', line 45 def handle(word) [remove_suffix(word, @suffix_size), @rule_num, self] if ends_with?(word, @pattern) end |
#to_s ⇒ Object
49 50 51 |
# File 'lib/rule.rb', line 49 def to_s "rule ##{@rule_num} (remove -#{@pattern[@pattern.size - @suffix_size, @suffix_size]} when the word ends in -#{@pattern})" end |