Class: UEAStemmer::EndingRule
Direct Known Subclasses
Instance Attribute Summary collapse
-
#original_pattern ⇒ Object
readonly
Returns the value of attribute original_pattern.
Attributes inherited from Rule
#pattern, #rule_num, #suffix_size
Instance Method Summary collapse
-
#initialize(pattern, suffix_size, rule_num) ⇒ EndingRule
constructor
A new instance of EndingRule.
- #to_s ⇒ Object
Methods inherited from Rule
Methods included from StringHelpers
Constructor Details
#initialize(pattern, suffix_size, rule_num) ⇒ EndingRule
Returns a new instance of EndingRule.
47 48 49 50 |
# File 'lib/uea-stemmer/rule.rb', line 47 def initialize(pattern, suffix_size, rule_num) super(/^.*#{pattern}$/, suffix_size, rule_num) @original_pattern = pattern.dup.freeze end |
Instance Attribute Details
#original_pattern ⇒ Object (readonly)
Returns the value of attribute original_pattern.
45 46 47 |
# File 'lib/uea-stemmer/rule.rb', line 45 def original_pattern @original_pattern end |
Instance Method Details
#to_s ⇒ Object
52 53 54 |
# File 'lib/uea-stemmer/rule.rb', line 52 def to_s "rule ##{@rule_num} (remove -#{@original_pattern[@original_pattern.size - @suffix_size, @suffix_size]} when the word ends in -#{@original_pattern})" end |