Package cc.mallet.types
Class LabelAlphabet
- java.lang.Object
-
- cc.mallet.types.Alphabet
-
- cc.mallet.types.LabelAlphabet
-
- All Implemented Interfaces:
java.io.Serializable
public class LabelAlphabet extends Alphabet implements java.io.Serializable
A mapping from arbitrary objects (usually String's) to integers (and corresponding Label objects) and back.- Author:
- Andrew McCallum mccallum@cs.umass.edu
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LabelAlphabet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
lookupIndex(java.lang.Object entry, boolean addIfNotPresent)
Return -1 if entry isn't present.Label
lookupLabel(int labelIndex)
Label
lookupLabel(java.lang.Object entry)
Label
lookupLabel(java.lang.Object entry, boolean addIfNotPresent)
-
Methods inherited from class cc.mallet.types.Alphabet
alphabetsMatch, clone, contains, dump, dump, dump, entryClass, getInstanceId, growthStopped, iterator, lookupIndex, lookupIndices, lookupObject, lookupObjects, lookupObjects, readResolve, setInstanceId, size, startGrowth, stopGrowth, toArray, toArray, toString
-
-
-
-
Method Detail
-
lookupIndex
public int lookupIndex(java.lang.Object entry, boolean addIfNotPresent)
Description copied from class:Alphabet
Return -1 if entry isn't present.- Overrides:
lookupIndex
in classAlphabet
-
lookupLabel
public Label lookupLabel(java.lang.Object entry, boolean addIfNotPresent)
-
lookupLabel
public Label lookupLabel(java.lang.Object entry)
-
lookupLabel
public Label lookupLabel(int labelIndex)
-
-