Package cc.mallet.types
Class FeatureConjunction
- java.lang.Object
-
- cc.mallet.types.FeatureConjunction
-
- All Implemented Interfaces:
java.io.Serializable
public class FeatureConjunction extends java.lang.Object implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FeatureConjunction.List
-
Constructor Summary
Constructors Constructor Description FeatureConjunction(Alphabet dictionary, int[] features)
FeatureConjunction(Alphabet dictionary, int[] features, boolean[] negations)
FeatureConjunction(java.lang.String name, Alphabet dictionary, int[] features, boolean[] negations)
FeatureConjunction(java.lang.String name, Alphabet dictionary, int[] features, boolean[] negations, boolean checkSorted)
FeatureConjunction(java.lang.String name, Alphabet dictionary, int[] features, boolean[] negations, boolean checkSorted, boolean copyFeatures, boolean copyNegations)
If negations[i] is true, insist that the feature has non-zero value; if false, insist that it has zero value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTo(AugmentableFeatureVector fv)
void
addTo(AugmentableFeatureVector fv, double value)
void
addTo(AugmentableFeatureVector fv, double value, FeatureSelection fs)
static boolean
featuresOverlap(Alphabet dictionary, int feature1, int feature2)
static int[]
getFeatureIndices(Alphabet dictionary, java.lang.String featureConjunctionName)
int
getIndex()
static java.lang.String
getName(Alphabet dictionary, int[] features)
static java.lang.String
getName(Alphabet dictionary, int[] features, boolean[] negations)
static java.lang.String
getName(Alphabet dictionary, int feature1, int feature2)
static boolean
isValidConjunction(int[] features)
boolean
satisfiedBy(FeatureVector fv)
-
-
-
Constructor Detail
-
FeatureConjunction
public FeatureConjunction(java.lang.String name, Alphabet dictionary, int[] features, boolean[] negations, boolean checkSorted, boolean copyFeatures, boolean copyNegations)
If negations[i] is true, insist that the feature has non-zero value; if false, insist that it has zero value. Note: Does not check to make sure that it hasn't already been added. If negations[] is null, then assume all negations[i] are true.
-
FeatureConjunction
public FeatureConjunction(java.lang.String name, Alphabet dictionary, int[] features, boolean[] negations, boolean checkSorted)
-
FeatureConjunction
public FeatureConjunction(java.lang.String name, Alphabet dictionary, int[] features, boolean[] negations)
-
FeatureConjunction
public FeatureConjunction(Alphabet dictionary, int[] features, boolean[] negations)
-
FeatureConjunction
public FeatureConjunction(Alphabet dictionary, int[] features)
-
-
Method Detail
-
isValidConjunction
public static boolean isValidConjunction(int[] features)
-
getName
public static java.lang.String getName(Alphabet dictionary, int[] features, boolean[] negations)
-
getName
public static java.lang.String getName(Alphabet dictionary, int[] features)
-
featuresOverlap
public static boolean featuresOverlap(Alphabet dictionary, int feature1, int feature2)
-
getName
public static java.lang.String getName(Alphabet dictionary, int feature1, int feature2)
-
getFeatureIndices
public static int[] getFeatureIndices(Alphabet dictionary, java.lang.String featureConjunctionName)
-
satisfiedBy
public boolean satisfiedBy(FeatureVector fv)
-
getIndex
public int getIndex()
-
addTo
public void addTo(AugmentableFeatureVector fv, double value, FeatureSelection fs)
-
addTo
public void addTo(AugmentableFeatureVector fv, double value)
-
addTo
public void addTo(AugmentableFeatureVector fv)
-
-