edu.stanford.nlp.classify
Class FeatureSet

java.lang.Object
  |
  +--edu.stanford.nlp.classify.FeatureSet

public class FeatureSet
extends Object

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

FeatureSet

public FeatureSet()
Constructor creates an empty FeatureSet


FeatureSet

public FeatureSet(HashMap features)
This constructor allows the creation of a FeatureSet from a HashMap of features

Method Detail

getIterator

public Iterator getIterator()

getSize

public int getSize()
Returns the number of features in the FeatureSet


getCount

public double getCount(Feature key)
Returns the count associated with the Feature key


hasNext

public boolean hasNext()
Used when iterating


reset

public void reset()
This method must be called before each iteration through the FeatureSet. This should be changed.


next

public Object next()
This method returns the next element in the set


addFeature

public void addFeature(Feature next)
Adds the feature "next" to this FeatureSet.


setID

public void setID(int my_id)
Sets the ID (true classification) of the FeatureSet.


getID

public int getID()
Returns the ID (true classification) of the FeatureSet.


contains

public boolean contains(Feature f)
Returns true if the FeatureSet contains Feature f, and false otherwise.



Stanford NLP Group