edu.stanford.nlp.ie.crf
Class CRFDatum<FEAT,LAB>

java.lang.Object
  extended by edu.stanford.nlp.ie.crf.CRFDatum<FEAT,LAB>
All Implemented Interfaces:
Serializable

public class CRFDatum<FEAT,LAB>
extends Object
implements Serializable

The representation of Datums used internally in CRFClassifier.

Author:
Jenny Finkel
See Also:
Serialized Form

Constructor Summary
CRFDatum(List<FEAT> features, LAB label)
          Constructs a new BasicDatum with the given features and label.
 
Method Summary
 List<FEAT> asFeatures()
          Returns the collection that this BasicDatum was constructed with.
 boolean equals(Object o)
          Returns whether the given Datum contains the same features as this Datum.
 int hashCode()
           
 LAB label()
          Returns the label for this Datum, or null if none have been set.
 String toString()
          Returns a String representation of this BasicDatum (lists features and labels).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CRFDatum

public CRFDatum(List<FEAT> features,
                LAB label)
Constructs a new BasicDatum with the given features and label.

Parameters:
features - The features of the CRFDatum
label - The label of the CRFDatum
Method Detail

asFeatures

public List<FEAT> asFeatures()
Returns the collection that this BasicDatum was constructed with.

Returns:
the collection that this BasicDatum was constructed with.

label

public LAB label()
Returns the label for this Datum, or null if none have been set.

Returns:
The label for this Datum, or null if none have been set.

toString

public String toString()
Returns a String representation of this BasicDatum (lists features and labels).

Overrides:
toString in class Object

equals

public boolean equals(Object o)
Returns whether the given Datum contains the same features as this Datum. Doesn't check the labels, should we change this? (CDM Feb 2012: Also doesn't correctly respect the contract for equals, since it gives one way equality with other Datum's.)

Overrides:
equals in class Object
Parameters:
o - The object to test equality with
Returns:
Whether it is equal to this CRFDatum in terms of features

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Stanford NLP Group