public class Alphabet extends Object implements Serializable
The most common use of an alphabet is as a dictionary of feature names
associated with a FeatureVector in an
Instance. In a simple document
classification usage,
each unique word in a document would be a unique entry in the Alphabet
with a unique integer associated with it. FeatureVectors rely on
the integer part of the mapping to efficiently represent the subset of
the Alphabet present in the FeatureVector.
FeatureVector,
Instance,
Pipe,
Serialized Form| Constructor and Description |
|---|
Alphabet() |
Alphabet(Class entryClass) |
Alphabet(int capacity) |
Alphabet(int capacity,
Class entryClass) |
| Modifier and Type | Method and Description |
|---|---|
Object |
clone() |
boolean |
contains(Object entry) |
void |
dump() |
void |
dump(PrintStream out) |
void |
dump(PrintWriter out) |
Class |
entryClass() |
VMID |
getInstanceId() |
boolean |
growthStopped() |
Iterator |
iterator() |
int |
lookupIndex(Object entry) |
int |
lookupIndex(Object entry,
boolean addIfNotPresent)
Return -1 if entry isn't present.
|
int[] |
lookupIndices(Object[] objects,
boolean addIfNotPresent) |
Object |
lookupObject(int index) |
Object[] |
lookupObjects(int[] indices) |
Object[] |
lookupObjects(int[] indices,
Object[] buf)
Returns an array of the objects corresponding to
|
Object |
readResolve()
This gets called after readObject; it lets the object decide whether
to return itself or return a previously read in version.
|
void |
setInstanceId(VMID id) |
int |
size() |
void |
startGrowth() |
void |
stopGrowth() |
Object[] |
toArray() |
Object[] |
toArray(Object[] in)
Returns an array containing all the entries in the Alphabet.
|
String |
toString()
Return String representation of all Alphabet entries, each
separated by a newline.
|
public Alphabet(int capacity,
Class entryClass)
public Alphabet(Class entryClass)
public Alphabet(int capacity)
public Alphabet()
public int lookupIndex(Object entry, boolean addIfNotPresent)
public int lookupIndex(Object entry)
public Object lookupObject(int index)
public Object[] toArray()
public Object[] toArray(Object[] in)
public Iterator iterator()
public Object[] lookupObjects(int[] indices)
public Object[] lookupObjects(int[] indices, Object[] buf)
indices - An array of indices to look upbuf - An array to store the returned objects in.public int[] lookupIndices(Object[] objects, boolean addIfNotPresent)
public boolean contains(Object entry)
public int size()
public void stopGrowth()
public void startGrowth()
public boolean growthStopped()
public Class entryClass()
public String toString()
public void dump()
public void dump(PrintStream out)
public void dump(PrintWriter out)
public VMID getInstanceId()
public void setInstanceId(VMID id)
public Object readResolve() throws ObjectStreamException
ObjectStreamExceptionCopyright © 2019 JULIE Lab, Germany. All rights reserved.