cc.mallet.types
Class FeatureCounter
java.lang.Object
cc.mallet.types.FeatureCounter
public class FeatureCounter
- extends java.lang.Object
Efficient, compact, incremental counting of features in an alphabet.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FeatureCounter
public FeatureCounter(Alphabet alphabet)
increment
public int increment(java.lang.Object entry)
increment
public int increment(java.lang.Object entry,
int incr)
increment
public int increment(int featureIndex)
increment
public int increment(int featureIndex,
int incr)
get
public int get(int featureIndex)
get
public int get(java.lang.Object entry)
- Unlike increment(Object), this method does not add the entry to the Alphabet if it is not there already.
put
public int put(int featureIndex,
int value)
put
public int put(java.lang.Object entry,
int value)
toFeatureVector
public FeatureVector toFeatureVector()
toRankedFeatureVector
public RankedFeatureVector toRankedFeatureVector()