Class: Zenlish::Trie::TrieNode

Inherits:
BaseTrieNode show all
Defined in:
lib/zenlish/trie/trie_node.rb

Instance Attribute Summary collapse

Attributes inherited from BaseTrieNode

#succ

Instance Method Summary collapse

Methods inherited from BaseTrieNode

#add_succ, #include?, #leaf?

Constructor Details

#initialize(aChar) ⇒ TrieNode

Returns a new instance of TrieNode.



14
15
16
17
18
# File 'lib/zenlish/trie/trie_node.rb', line 14

def initialize(aChar)
  super()
  @key = aChar
  @value = nil
end

Instance Attribute Details

#keyString (readonly)

Returns the matching character.

Returns:

  • (String)

    the matching character



9
10
11
# File 'lib/zenlish/trie/trie_node.rb', line 9

def key
  @key
end

#valueObject, NilClass

Returns Result when this character matches end-of-word.

Returns:

  • (Object, NilClass)

    Result when this character matches end-of-word.



12
13
14
# File 'lib/zenlish/trie/trie_node.rb', line 12

def value
  @value
end