Class: SClust::Util::Filter::StemmedWord
- Inherits:
-
Object
- Object
- SClust::Util::Filter::StemmedWord
- Defined in:
- lib/sclust/util/filters.rb
Instance Attribute Summary collapse
-
#original_word ⇒ Object
Returns the value of attribute original_word.
-
#stemmed_word ⇒ Object
Returns the value of attribute stemmed_word.
Instance Method Summary collapse
- #+(sw) ⇒ Object
- #<(sw) ⇒ Object
- #<=>(sw) ⇒ Object
- #==(sw) ⇒ Object
-
#initialize(stemmed_word, original_word) ⇒ StemmedWord
constructor
A new instance of StemmedWord.
- #initialize_copy(s) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(stemmed_word, original_word) ⇒ StemmedWord
Returns a new instance of StemmedWord.
39 40 41 42 43 44 |
# File 'lib/sclust/util/filters.rb', line 39 def initialize(stemmed_word, original_word) #super(stemmed_word) @stemmed_word = stemmed_word @original_word = String.new(original_word) end |
Instance Attribute Details
#original_word ⇒ Object
Returns the value of attribute original_word.
36 37 38 |
# File 'lib/sclust/util/filters.rb', line 36 def original_word @original_word end |
#stemmed_word ⇒ Object
Returns the value of attribute stemmed_word.
36 37 38 |
# File 'lib/sclust/util/filters.rb', line 36 def stemmed_word @stemmed_word end |
Instance Method Details
#+(sw) ⇒ Object
73 74 75 76 77 78 79 80 81 |
# File 'lib/sclust/util/filters.rb', line 73 def +(sw) if ( sw.nil?) self elsif (sw.is_a?(String) ) StemmedWord.new(@stemmed_word + sw, @original_word + sw) else StemmedWord.new(@stemmed_word + sw.stemmed_word, @original_word + sw.original_word) end end |
#<(sw) ⇒ Object
58 59 60 |
# File 'lib/sclust/util/filters.rb', line 58 def < (sw) @stemmed_word< sw.stemmed_word end |
#<=>(sw) ⇒ Object
69 70 71 |
# File 'lib/sclust/util/filters.rb', line 69 def <=>(sw) @stemmed_word <=> sw.stemmed_word end |
#==(sw) ⇒ Object
65 66 67 |
# File 'lib/sclust/util/filters.rb', line 65 def ==(sw) @stemmed_word == sw.stemmed_word end |
#initialize_copy(s) ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/sclust/util/filters.rb', line 46 def initialize_copy(s) super(s) if ( stemmed_word.class == "SClust::Filter::StemmedWord" ) @original_word = s.original_word end end |
#to_s ⇒ Object
54 55 56 |
# File 'lib/sclust/util/filters.rb', line 54 def to_s() @stemmed_word end |