calhoun.analysis.crf.features.generic
Class StartFeatures

java.lang.Object
  extended by calhoun.analysis.crf.AbstractFeatureManager<java.lang.Object>
      extended by calhoun.analysis.crf.features.generic.StartFeatures
All Implemented Interfaces:
FeatureManager<java.lang.Object>, FeatureManagerNode<java.lang.Object>, java.io.Serializable

public class StartFeatures
extends AbstractFeatureManager<java.lang.Object>
implements FeatureManagerNode<java.lang.Object>

indicator functions that evaluate to true for a selected set of start states at the first position in the sequence.

See Also:
Serialized Form

Constructor Summary
StartFeatures()
           
 
Method Summary
 void evaluateNode(InputSequence<?> seq, int pos, int state, FeatureList result)
          Evaluates the set of features managed by this object for the given arguments.
 java.lang.String getFeatureName(int featureIndex)
          Returns a human identifiable name for the feature referenced by a given index.
 int getNumFeatures()
          Returns the number of features maintained by this FeatureManager.
 void setStates(int[] config)
           
 void train(int startingIndex, ModelManager modelInfo, java.util.List data)
          Start features don't train based on the data.
 
Methods inherited from class calhoun.analysis.crf.AbstractFeatureManager
getCacheStrategy, 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
getCacheStrategy, getInputComponent, setInputComponent
 

Constructor Detail

StartFeatures

public StartFeatures()
Method Detail

setStates

public void setStates(int[] config)

getFeatureName

public java.lang.String getFeatureName(int featureIndex)
Description copied from interface: FeatureManager
Returns a human identifiable name for the feature referenced by a given index. Used for display purposes only.

Specified by:
getFeatureName in interface FeatureManager<java.lang.Object>
Parameters:
featureIndex - the index of this feature
Returns:
the human readable name of this feature

getNumFeatures

public int getNumFeatures()
Description copied from interface: FeatureManager
Returns the number of features maintained by this FeatureManager. This number must be fixed after the call to trainFeatures is complete.

Specified by:
getNumFeatures in interface FeatureManager<java.lang.Object>
Returns:
number of features managed by this FeatureManager

evaluateNode

public void evaluateNode(InputSequence<?> seq,
                         int pos,
                         int state,
                         FeatureList result)
Description copied from interface: FeatureManagerNode
Evaluates the set of features managed by this object for the given arguments.

Specified by:
evaluateNode in interface FeatureManagerNode<java.lang.Object>

train

public void train(int startingIndex,
                  ModelManager modelInfo,
                  java.util.List data)
Start features don't train based on the data. Just set up based on the model.

Specified by:
train in interface FeatureManager<java.lang.Object>
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