Class: SuffixTree::Node
- Inherits:
-
Object
- Object
- SuffixTree::Node
- Defined in:
- lib/suffix_tree/node.rb
Instance Attribute Summary collapse
-
#c_value ⇒ Object
Returns the value of attribute c_value.
-
#c_values ⇒ Object
Returns the value of attribute c_values.
-
#child ⇒ Object
Returns the value of attribute child.
-
#end ⇒ Object
Returns the value of attribute end.
-
#index ⇒ Object
Returns the value of attribute index.
-
#start ⇒ Object
Returns the value of attribute start.
-
#suffix_link ⇒ Object
Returns the value of attribute suffix_link.
Instance Method Summary collapse
-
#initialize(start, end_p, word_count) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(start, end_p, word_count) ⇒ Node
Returns a new instance of Node.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/suffix_tree/node.rb', line 7 def initialize(start, end_p, word_count) @child = {} @suffix_link = nil @start = start @end = end_p @index = 0 @depth = 0 @c_value = 0 @c_values = [0] * word_count end |
Instance Attribute Details
#c_value ⇒ Object
Returns the value of attribute c_value.
5 6 7 |
# File 'lib/suffix_tree/node.rb', line 5 def c_value @c_value end |
#c_values ⇒ Object
Returns the value of attribute c_values.
5 6 7 |
# File 'lib/suffix_tree/node.rb', line 5 def c_values @c_values end |
#child ⇒ Object
Returns the value of attribute child.
5 6 7 |
# File 'lib/suffix_tree/node.rb', line 5 def child @child end |
#end ⇒ Object
Returns the value of attribute end.
5 6 7 |
# File 'lib/suffix_tree/node.rb', line 5 def end @end end |
#index ⇒ Object
Returns the value of attribute index.
5 6 7 |
# File 'lib/suffix_tree/node.rb', line 5 def index @index end |
#start ⇒ Object
Returns the value of attribute start.
5 6 7 |
# File 'lib/suffix_tree/node.rb', line 5 def start @start end |
#suffix_link ⇒ Object
Returns the value of attribute suffix_link.
5 6 7 |
# File 'lib/suffix_tree/node.rb', line 5 def suffix_link @suffix_link end |