|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Trie
An implementation of tries with linked lists
Field Summary | |
int |
size
number of elements in the trie |
Constructor Summary | |
Trie(Alphabet a)
|
Method Summary | |
void |
addToTrie(java.lang.String s)
Adds the word s to the trie. |
void |
fromFile(java.lang.String name)
|
boolean |
isInTrie(java.lang.String s)
|
Trie.Pair |
longestPrefixInTrie(java.lang.String s,
int j)
Computes the pair composed of the length of the longest prefix of s[j..n-1] in the trie and the vertex reached by this prefix. |
static void |
main(java.lang.String[] args)
|
void |
removeFromTrie(java.lang.String s)
removes the string s from the trie. |
DFA |
toDFA()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public int size
Constructor Detail |
public Trie(Alphabet a)
Method Detail |
public Trie.Pair longestPrefixInTrie(java.lang.String s, int j)
s
- the input stringj
- the starting index
public boolean isInTrie(java.lang.String s)
public void addToTrie(java.lang.String s)
s
- the string to be addedpublic void removeFromTrie(java.lang.String s)
s
- the string to be removedpublic java.lang.String toString()
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException
public void fromFile(java.lang.String name) throws java.io.IOException
java.io.IOException
public DFA toDFA()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |