edu.cmu.minorthird.text
Class Trie

java.lang.Object
  extended by edu.cmu.minorthird.text.Trie

public class Trie
extends java.lang.Object

Efficient scheme for matching a rote list of sequences of tokens.

Author:
William Cohen

Nested Class Summary
static interface Trie.ResultIterator
          An extension of Span.Looper which also returns the ids associated with a Span.
 
Constructor Summary
Trie()
           
 
Method Summary
 void addWords(java.lang.String id, java.lang.String[] words)
          Associate a sequence of words with a given id.
 Trie.ResultIterator lookup(Span span)
          Lookup matches to the trie in the span
static void main(java.lang.String[] argv)
           
 java.lang.String toString()
          Pretty-print the entire trie.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Trie

public Trie()
Method Detail

lookup

public Trie.ResultIterator lookup(Span span)
Lookup matches to the trie in the span


addWords

public void addWords(java.lang.String id,
                     java.lang.String[] words)
Associate a sequence of words with a given id.


toString

public java.lang.String toString()
Pretty-print the entire trie.

Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] argv)