edu.umass.cs.mallet.base.types
Class LabelAlphabet
java.lang.Object
edu.umass.cs.mallet.base.types.Alphabet
edu.umass.cs.mallet.base.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.
- See Also:
- Serialized Form
Methods inherited from class edu.umass.cs.mallet.base.types.Alphabet |
clone, contains, dump, dump, dump, entryClass, getInstanceId, growthStopped, iterator, lookupIndex, lookupIndices, lookupObject, lookupObjects, lookupObjects, readResolve, setInstanceId, size, startGrowth, stopGrowth, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
LabelAlphabet
public LabelAlphabet()
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 class Alphabet
lookupLabel
public Label lookupLabel(java.lang.Object entry,
boolean addIfNotPresent)
lookupLabel
public Label lookupLabel(java.lang.Object entry)
lookupLabel
public Label lookupLabel(int labelIndex)