Class: SuffixTree::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/suffix_tree/node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_valueObject

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_valuesObject

Returns the value of attribute c_values.



5
6
7
# File 'lib/suffix_tree/node.rb', line 5

def c_values
  @c_values
end

#childObject

Returns the value of attribute child.



5
6
7
# File 'lib/suffix_tree/node.rb', line 5

def child
  @child
end

#endObject

Returns the value of attribute end.



5
6
7
# File 'lib/suffix_tree/node.rb', line 5

def end
  @end
end

#indexObject

Returns the value of attribute index.



5
6
7
# File 'lib/suffix_tree/node.rb', line 5

def index
  @index
end

#startObject

Returns the value of attribute start.



5
6
7
# File 'lib/suffix_tree/node.rb', line 5

def start
  @start
end

Returns the value of attribute suffix_link.



5
6
7
# File 'lib/suffix_tree/node.rb', line 5

def suffix_link
  @suffix_link
end