Class: Okura::Node
- Inherits:
-
Object
- Object
- Okura::Node
- Defined in:
- lib/okura.rb
Instance Attribute Summary collapse
-
#nearest_prev ⇒ Object
Returns the value of attribute nearest_prev.
-
#total_cost ⇒ Object
Returns the value of attribute total_cost.
-
#word ⇒ Object
readonly
Returns the value of attribute word.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(word) ⇒ Node
constructor
A new instance of Node.
- #length ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(word) ⇒ Node
Returns a new instance of Node.
86 87 88 89 90 |
# File 'lib/okura.rb', line 86 def initialize word @word=word @nearest_prev=nil @total_cost=nil end |
Instance Attribute Details
#nearest_prev ⇒ Object
Returns the value of attribute nearest_prev.
92 93 94 |
# File 'lib/okura.rb', line 92 def nearest_prev @nearest_prev end |
#total_cost ⇒ Object
Returns the value of attribute total_cost.
93 94 95 |
# File 'lib/okura.rb', line 93 def total_cost @total_cost end |
#word ⇒ Object (readonly)
Returns the value of attribute word.
91 92 93 |
# File 'lib/okura.rb', line 91 def word @word end |
Class Method Details
Instance Method Details
#length ⇒ Object
94 95 96 |
# File 'lib/okura.rb', line 94 def length word.surface.length end |
#to_s ⇒ Object
97 98 99 |
# File 'lib/okura.rb', line 97 def to_s "Node(#{word},#{total_cost})" end |