Class: UEAStemmer::NonExhaustiveEndingRule

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

Instance Attribute Summary

Attributes inherited from Rule

#pattern, #rule_num, #suffix_size

Instance Method Summary collapse

Methods inherited from Rule

#initialize

Methods included from StringHelpers

#ends_with?, #remove_suffix

Constructor Details

This class inherits a constructor from UEAStemmer::Rule

Instance Method Details

#handle(word) ⇒ Object



72
73
74
# File 'lib/rule.rb', line 72

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

#to_sObject



76
77
78
# File 'lib/rule.rb', line 76

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