public class FrontCodedDictionary extends Object implements Writable, LexicographicallySortedDictionary
| Constructor and Description |
|---|
FrontCodedDictionary() |
| Modifier and Type | Method and Description |
|---|---|
int |
getId(String term)
Returns the id associated with this term.
|
String |
getTerm(int id)
Returns the term associated with this term id.
|
Iterator<String> |
iterator() |
static void |
main(String[] args)
Simple demo program for looking up terms and term ids.
|
void |
readFields(DataInput in) |
int |
size()
Returns the size of this dictionary.
|
void |
write(DataOutput out) |
public int getId(String term)
DictionarygetId in interface Dictionaryterm - termpublic String getTerm(int id)
DictionarygetTerm in interface Dictionaryid - term idpublic static void main(String[] args) throws Exception
Exceptionpublic void readFields(DataInput in) throws IOException
readFields in interface WritableIOExceptionpublic int size()
Dictionarysize in interface Dictionarypublic void write(DataOutput out) throws IOException
write in interface WritableIOException