|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.terrier.structures.Lexicon<java.lang.String>
org.terrier.structures.MapLexicon
public abstract class MapLexicon
Implementation of a lexicon. This class should be subclassed by any lexicon implementation which use a java.util.Map for storing entries.
| Nested Class Summary | |
|---|---|
protected static interface |
MapLexicon.Id2EntryIndexLookup
|
protected static class |
MapLexicon.IdIsIndex
|
| Field Summary | |
|---|---|
protected WriteableFactory<org.apache.hadoop.io.Text> |
keyFactory
|
| Constructor Summary | |
|---|---|
MapLexicon(java.util.Map<org.apache.hadoop.io.Text,LexiconEntry> backingMap)
Construct an instance of the class with |
|
MapLexicon(java.util.Map<org.apache.hadoop.io.Text,LexiconEntry> backingMap,
MapLexicon.Id2EntryIndexLookup idlookupobject)
Construct an instance of the class with |
|
| Method Summary | |
|---|---|
void |
close()
|
java.util.Map.Entry<java.lang.String,LexiconEntry> |
getIthLexiconEntry(int index)
Get the term and LexiconEntry (contains statistics and a pointer) for the entry in the lexicon with the specified index. |
java.util.Map.Entry<java.lang.String,LexiconEntry> |
getLexiconEntry(int termid)
Get the term and LexiconEntry (contains statistics and a pointer) for a given term id. |
LexiconEntry |
getLexiconEntry(java.lang.String term)
Get the LexiconEntry (contains statistics and a pointer) for the given term. |
int |
numberOfEntries()
Return the number of entries in the lexicon |
protected void |
setTermIdLookup(MapLexicon.Id2EntryIndexLookup idlookupobject)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Field Detail |
|---|
protected WriteableFactory<org.apache.hadoop.io.Text> keyFactory
| Constructor Detail |
|---|
public MapLexicon(java.util.Map<org.apache.hadoop.io.Text,LexiconEntry> backingMap)
backingMap -
public MapLexicon(java.util.Map<org.apache.hadoop.io.Text,LexiconEntry> backingMap,
MapLexicon.Id2EntryIndexLookup idlookupobject)
backingMap - idlookupobject - | Method Detail |
|---|
protected void setTermIdLookup(MapLexicon.Id2EntryIndexLookup idlookupobject)
public LexiconEntry getLexiconEntry(java.lang.String term)
getLexiconEntry in class Lexicon<java.lang.String>term - key to lookup the lexicon with
public java.util.Map.Entry<java.lang.String,LexiconEntry> getIthLexiconEntry(int index)
getIthLexiconEntry in class Lexicon<java.lang.String>index - the entry number to lookup in the lexicon
public java.util.Map.Entry<java.lang.String,LexiconEntry> getLexiconEntry(int termid)
getLexiconEntry in class Lexicon<java.lang.String>termid - the term id to lookup in the lexicon
public int numberOfEntries()
numberOfEntries in class Lexicon<java.lang.String>
public void close()
throws java.io.IOException
close in interface java.io.Closeablejava.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||