public class TrieDictionary extends Dictionary
Dictionary.Entry| Constructor and Description |
|---|
TrieDictionary(File trieFile,
File cdbFile) |
TrieDictionary(String trieFilename,
String cdbFilename) |
| Modifier and Type | Method and Description |
|---|---|
Dictionary.Entry |
lookup(int pos)
look for a dictionary entry matching the token sequence beginning at
token
pos. |
void |
lookupStart(String[] tokens)
initializes the dictionary look-up process for the text consisting of
tokens
tokens. |
static void |
main(String[] args) |
static void |
prepare(String dictFilename,
String encoding,
String trieFilename,
String cdbFilename) |
static String |
readText(String filename,
String encoding) |
static void |
testDict(String text,
String trieFilename,
String cdbFilename) |
lookuppublic TrieDictionary(File trieFile, File cdbFile) throws IOException
IOExceptionpublic TrieDictionary(String trieFilename, String cdbFilename) throws IOException
IOExceptionpublic void lookupStart(String[] tokens)
tokens.lookupStart in class Dictionarypublic Dictionary.Entry lookup(int pos)
pos.lookup in class Dictionarypos - the position within the token array passed to lookupStartnull if no entry matchespublic static void main(String[] args) throws IOException
IOExceptionpublic static String readText(String filename, String encoding) throws IOException
IOExceptionpublic static void prepare(String dictFilename, String encoding, String trieFilename, String cdbFilename) throws IOException
IOExceptionpublic static void testDict(String text, String trieFilename, String cdbFilename) throws IOException
IOExceptionCopyright © 2016 New York University. All rights reserved.