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)
Dictionary
getId
in interface Dictionary
term
- termpublic String getTerm(int id)
Dictionary
getTerm
in interface Dictionary
id
- term idpublic static void main(String[] args) throws Exception
Exception
public void readFields(DataInput in) throws IOException
readFields
in interface Writable
IOException
public int size()
Dictionary
size
in interface Dictionary
public void write(DataOutput out) throws IOException
write
in interface Writable
IOException