Class: TrieTree::TrieNode
- Inherits:
-
Object
- Object
- TrieTree::TrieNode
- Defined in:
- lib/trie_suggest.rb
Overview
Trie tree node
Instance Attribute Summary collapse
-
#is_word ⇒ Object
Returns the value of attribute is_word.
-
#next ⇒ Object
Returns the value of attribute next.
-
#score ⇒ Object
Returns the value of attribute score.
-
#val ⇒ Object
Returns the value of attribute val.
Instance Method Summary collapse
-
#initialize(val) ⇒ TrieNode
constructor
A new instance of TrieNode.
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_word ⇒ Object
Returns the value of attribute is_word.
29 30 31 |
# File 'lib/trie_suggest.rb', line 29 def is_word @is_word end |
#next ⇒ Object
Returns the value of attribute next.
29 30 31 |
# File 'lib/trie_suggest.rb', line 29 def next @next end |
#score ⇒ Object
Returns the value of attribute score.
29 30 31 |
# File 'lib/trie_suggest.rb', line 29 def score @score end |
#val ⇒ Object
Returns the value of attribute val.
29 30 31 |
# File 'lib/trie_suggest.rb', line 29 def val @val end |