Class: SClust::Util::Word
- Inherits:
-
Object
- Object
- SClust::Util::Word
- Defined in:
- lib/sclust/util/word.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#weight ⇒ Object
Returns the value of attribute weight.
-
#word ⇒ Object
Returns the value of attribute word.
Instance Method Summary collapse
- #eql?(w) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(word = "", weight = 0.0, other_data = {}) ⇒ Word
constructor
A new instance of Word.
-
#to_s ⇒ Object
Return @word.
Constructor Details
#initialize(word = "", weight = 0.0, other_data = {}) ⇒ Word
Returns a new instance of Word.
33 34 35 36 37 |
# File 'lib/sclust/util/word.rb', line 33 def initialize(word="", weight=0.0, other_data={}) @word = word @weight = weight @data = other_data end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
30 31 32 |
# File 'lib/sclust/util/word.rb', line 30 def data @data end |
#weight ⇒ Object
Returns the value of attribute weight.
30 31 32 |
# File 'lib/sclust/util/word.rb', line 30 def weight @weight end |
#word ⇒ Object
Returns the value of attribute word.
30 31 32 |
# File 'lib/sclust/util/word.rb', line 30 def word @word end |
Instance Method Details
#eql?(w) ⇒ Boolean
48 49 50 |
# File 'lib/sclust/util/word.rb', line 48 def eql?(w) @word.eql?(w) end |
#hash ⇒ Object
44 45 46 |
# File 'lib/sclust/util/word.rb', line 44 def hash @word.hash end |
#to_s ⇒ Object
Return @word.
40 41 42 |
# File 'lib/sclust/util/word.rb', line 40 def to_s @word end |