public class DoubleArrayTrie
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DOUBLE_ARRAY_TRIE_FILENAME |
static char |
TERMINATING_CHARACTER |
Constructor and Description |
---|
DoubleArrayTrie() |
DoubleArrayTrie(boolean compactTries) |
Modifier and Type | Method and Description |
---|---|
void |
build(Trie trie)
Construct double array trie which is equivalent to input trie
|
java.nio.IntBuffer |
getBaseBuffer() |
java.nio.IntBuffer |
getCheckBuffer() |
java.nio.CharBuffer |
getTailBuffer() |
int |
lookup(java.lang.String key)
Match input keyword.
|
int |
lookup(java.lang.String key,
int index,
int j) |
static DoubleArrayTrie |
newInstance(ResourceResolver resolver) |
static DoubleArrayTrie |
read(java.io.InputStream input)
Load Stored data
|
void |
write(java.io.OutputStream output) |
public static final java.lang.String DOUBLE_ARRAY_TRIE_FILENAME
public static final char TERMINATING_CHARACTER
public DoubleArrayTrie()
public DoubleArrayTrie(boolean compactTries)
public void write(java.io.OutputStream output) throws java.io.IOException
java.io.IOException
public static DoubleArrayTrie newInstance(ResourceResolver resolver) throws java.io.IOException
java.io.IOException
public static DoubleArrayTrie read(java.io.InputStream input) throws java.io.IOException
input
- input stream to read the double array trie fromjava.io.IOException
- if an IO error occured during reading the double array triepublic void build(Trie trie)
trie
- normal trie, which contains all dictionary wordspublic int lookup(java.lang.String key)
key
- key to matchpublic int lookup(java.lang.String key, int index, int j)
public java.nio.IntBuffer getBaseBuffer()
public java.nio.IntBuffer getCheckBuffer()
public java.nio.CharBuffer getTailBuffer()