|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.stanford.nlp.classify.FeatureSet
This class stores pairs of features and counts.
Constructor Summary | |
FeatureSet()
Constructor creates an empty FeatureSet |
|
FeatureSet(HashMap features)
This constructor allows the creation of a FeatureSet from a HashMap of features |
Method Summary | |
void |
addFeature(Feature next)
Adds the feature "next" to this FeatureSet. |
boolean |
contains(Feature f)
Returns true if the FeatureSet contains Feature f, and false otherwise. |
double |
getCount(Feature key)
Returns the count associated with the Feature key |
int |
getID()
Returns the ID (true classification) of the FeatureSet. |
Iterator |
getIterator()
|
int |
getSize()
Returns the number of features in the FeatureSet |
boolean |
hasNext()
Used when iterating |
Object |
next()
This method returns the next element in the set |
void |
reset()
This method must be called before each iteration through the FeatureSet. |
void |
setID(int my_id)
Sets the ID (true classification) of the FeatureSet. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FeatureSet()
public FeatureSet(HashMap features)
Method Detail |
public Iterator getIterator()
public int getSize()
public double getCount(Feature key)
public boolean hasNext()
public void reset()
public Object next()
public void addFeature(Feature next)
public void setID(int my_id)
public int getID()
public boolean contains(Feature f)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |