calhoun.analysis.crf
Class ConstrainedFeatureManager

java.lang.Object
  extended by calhoun.analysis.crf.AbstractFeatureManager
      extended by calhoun.analysis.crf.CompositeFeatureManager
          extended by calhoun.analysis.crf.ConstrainedFeatureManager
All Implemented Interfaces:
FeatureManager, FeatureManagerEdge, FeatureManagerEdgeExplicitLength, FeatureManagerNode, FeatureManagerNodeExplicitLength, java.io.Serializable

public class ConstrainedFeatureManager
extends CompositeFeatureManager

a feature manager that combines it's composite feature types together into a single feature.

See Also:
Serialized Form

Constructor Summary
ConstrainedFeatureManager()
           
 
Method Summary
 java.lang.String getFeatureName(int featureIndex)
          Return a concatenated name
 int getNumFeatures()
          Composite feature managers only return 1 feature.
 void train(int startingIndex, ModelManager modelInfo, java.util.List data)
          Provides access to the entire training set so that FeatureManager can compute global properties and assign feature indices.
 
Methods inherited from class calhoun.analysis.crf.CompositeFeatureManager
addFeatureManager, addFeatureManager, evaluateEdge, evaluateEdgeLength, evaluateNode, evaluateNodeLength, getCacheStrategy, getComponentFeatures, getFeatureOffset, setComponentFeatures
 
Methods inherited from class calhoun.analysis.crf.AbstractFeatureManager
getInputComponent, setInputComponent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface calhoun.analysis.crf.FeatureManager
getInputComponent, setInputComponent
 
Methods inherited from interface calhoun.analysis.crf.FeatureManager
getInputComponent, setInputComponent
 
Methods inherited from interface calhoun.analysis.crf.FeatureManager
getInputComponent, setInputComponent
 
Methods inherited from interface calhoun.analysis.crf.FeatureManager
getInputComponent, setInputComponent
 

Constructor Detail

ConstrainedFeatureManager

public ConstrainedFeatureManager()
Method Detail

getNumFeatures

public int getNumFeatures()
Composite feature managers only return 1 feature.

Specified by:
getNumFeatures in interface FeatureManager
Overrides:
getNumFeatures in class CompositeFeatureManager
Returns:
number of features managed by this FeatureManager

getFeatureName

public java.lang.String getFeatureName(int featureIndex)
Return a concatenated name

Specified by:
getFeatureName in interface FeatureManager
Overrides:
getFeatureName in class CompositeFeatureManager
Parameters:
featureIndex - the index of this feature
Returns:
the human readable name of this feature

train

public void train(int startingIndex,
                  ModelManager modelInfo,
                  java.util.List data)
Description copied from interface: FeatureManager
Provides access to the entire training set so that FeatureManager can compute global properties and assign feature indices. This will be called before any evaluations are requested. If the FeatureManager can have a variable number of features, this must be fixed within this method.

Specified by:
train in interface FeatureManager
Overrides:
train in class CompositeFeatureManager
Parameters:
startingIndex - the feature index of the first feature owned by this FeatureManager. Each FeatureManager must use up consecutive indexes, so the last index used will be startingIndex + numFeatures - 1.
modelInfo - the model that contains this feature
data - the full list of training sequences to use to train the feature