Class: TrieTree::TrieNode

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

Overview

Trie tree node

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(val) ⇒ TrieNode

Returns a new instance of TrieNode.



30
31
32
33
34
# File 'lib/trie_suggest.rb', line 30

def initialize(val)
  @val = val
  @score = 0
  @next = {}
end

Instance Attribute Details

#is_wordObject

Returns the value of attribute is_word.



29
30
31
# File 'lib/trie_suggest.rb', line 29

def is_word
  @is_word
end

#nextObject

Returns the value of attribute next.



29
30
31
# File 'lib/trie_suggest.rb', line 29

def next
  @next
end

#scoreObject

Returns the value of attribute score.



29
30
31
# File 'lib/trie_suggest.rb', line 29

def score
  @score
end

#valObject

Returns the value of attribute val.



29
30
31
# File 'lib/trie_suggest.rb', line 29

def val
  @val
end