|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.ling.RVFDatum<L,F>
L
- The type of the label of the datumF
- The type of individual features stored in the datumpublic class RVFDatum<L,F>
A basic implementation of the Datum interface that can be constructed with a Collection of features and one more more labels. The features must be specified at construction, but the labels can be set and/or changed later.
Constructor Summary | |
---|---|
RVFDatum()
Constructs a new RVFDatum with no features or labels. |
|
RVFDatum(Counter<F> features)
Constructs a new RVFDatum with the given features and no labels. |
|
RVFDatum(Counter<F> features,
L label)
Constructs a new RVFDatum with the given features and label. |
|
RVFDatum(Datum<L,F> m)
Constructs a new RVFDatum taking the data from a Datum. |
Method Summary | |
---|---|
Collection<F> |
asFeatures()
Returns the list of features without values |
Counter<F> |
asFeaturesCounter()
Returns the Counter of features and values |
boolean |
equals(Object o)
Returns whether the given RVFDatum contains the same features with the same values as this RVFDatum. |
double |
getFeatureCount(F feature)
|
int |
hashCode()
|
L |
label()
Returns the primary label for this Object, or null if none have been set. |
Collection<L> |
labels()
Returns the complete list of labels for this Object, which may be empty. |
void |
setLabel(L label)
Removes all currently assigned Labels for this Datum then adds the given Label. |
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 |
---|
public RVFDatum(Counter<F> features, L label)
public RVFDatum(Datum<L,F> m)
m
- The Datum to copy.public RVFDatum(Counter<F> features)
public RVFDatum()
Method Detail |
---|
public Counter<F> asFeaturesCounter()
public Collection<F> asFeatures()
asFeatures
in interface Featurizable<F>
public void setLabel(L label)
public String toString()
toString
in class Object
public L label()
Labeled
label
in interface Labeled<L>
public Collection<L> labels()
Labeled
labels
in interface Labeled<L>
public double getFeatureCount(F feature)
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |