Package 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.
-
-
Constructor Summary
Constructors Constructor Description FeatureCounter(Alphabet alphabet)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
get(int featureIndex)
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.int
increment(int featureIndex)
int
increment(int featureIndex, int incr)
int
increment(java.lang.Object entry)
int
increment(java.lang.Object entry, int incr)
int
put(int featureIndex, int value)
int
put(java.lang.Object entry, int value)
FeatureVector
toFeatureVector()
RankedFeatureVector
toRankedFeatureVector()
-
-
-
Constructor Detail
-
FeatureCounter
public FeatureCounter(Alphabet alphabet)
-
-
Method Detail
-
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()
-
-