cc.mallet.types
Class FeatureCounter

java.lang.Object
  extended by cc.mallet.types.FeatureCounter

public class FeatureCounter
extends java.lang.Object

Efficient, compact, incremental counting of features in an alphabet.


Constructor Summary
FeatureCounter(Alphabet alphabet)
           
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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()