Package smile.nlp

Class Trie.Node

java.lang.Object
smile.nlp.Trie.Node
Enclosing class:
Trie<K,V>

public class Trie.Node extends Object
The nodes in the trie.
  • Constructor Details

    • Node

      public Node(K key)
      Constructor.
      Parameters:
      key - the key.
  • Method Details

    • getKey

      public K getKey()
      Returns the key.
      Returns:
      the key.
    • getValue

      public V getValue()
      Returns the value.
      Returns:
      the value.
    • getChild

      public V getChild(K[] key, int index)
      Returns the value matching the key sequence.
      Parameters:
      key - the key sequence.
      index - the index of current element in the key sequence.
      Returns:
      the value.
    • getChild

      public Trie<K,V>.Node getChild(K key)
      Returns the child with the key.
      Parameters:
      key - the key.
      Returns:
      the child.
    • addChild

      public void addChild(K[] key, V value, int index)
      Adds a child.
      Parameters:
      key - the key sequence.
      value - the value.
      index - the index of current element in the key sequence.