marytts.features
Class TargetFeatureComputer

java.lang.Object
  extended by marytts.features.TargetFeatureComputer

public class TargetFeatureComputer
extends java.lang.Object

Compute a given set of features for a Target.

Author:
schroed

Field Summary
protected  ByteValuedFeatureProcessor[] byteValuedDiscreteFeatureProcessors
           
protected  ContinuousFeatureProcessor[] continuousFeatureProcessors
           
protected  FeatureDefinition featureDefinition
           
protected  java.lang.String pauseSymbol
           
protected  ShortValuedFeatureProcessor[] shortValuedDiscreteFeatureProcessors
           
 
Constructor Summary
TargetFeatureComputer(FeatureProcessorManager manager, java.lang.String featureProcessorNames)
          Construct a TargetFeatureComputer that knows how to compute features for a Target using the given set of feature processor names.
 
Method Summary
 FeatureVector computeFeatureVector(Target target)
          Using the set of feature processors defined when creating the target feature computer, compute a feature vector for the target
 java.lang.String getAllFeatureProcessorNames()
          List the names of all feature processors.
 java.lang.String getAllFeatureProcessorNamesAndValues()
          List the names and values of all feature processors.
 java.lang.String getByteValuedFeatureProcessorNames()
          List the names of all byte-valued feature processors, separated by space characters.
 java.lang.String getByteValuedFeatureProcessorNamesAndValues()
          List the names of all byte-valued feature processors and their possible values.
 ByteValuedFeatureProcessor[] getByteValuedFeatureProcessors()
           
 java.lang.String getContinuousFeatureProcessorNames()
          List the names of all byte-valued feature processors, separated by space characters.
 java.lang.String getContinuousFeatureProcessorNamesAndValues()
          List the names of all continuous feature processors and their possible values.
 ContinuousFeatureProcessor[] getContinuousFeatureProcessors()
           
 FeatureDefinition getFeatureDefinition()
          Provide the feature definition that can be used to interpret the feature processors generated by this TargetFeatureComputer.
 java.lang.String getPauseSymbol()
          Get the pause symbol as associated with the "phone" feature processor used.
 java.lang.String getShortValuedFeatureProcessorNames()
          List the names of all short-valued feature processors, separated by space characters.
 java.lang.String getShortValuedFeatureProcessorNamesAndValues()
          List the names of all short-valued feature processors and their possible values.
 ShortValuedFeatureProcessor[] getShortValuedFeatureProcessors()
           
 java.lang.String toStringValues(FeatureVector features)
          For the given feature vector, convert each encoded value into its string representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

byteValuedDiscreteFeatureProcessors

protected ByteValuedFeatureProcessor[] byteValuedDiscreteFeatureProcessors

shortValuedDiscreteFeatureProcessors

protected ShortValuedFeatureProcessor[] shortValuedDiscreteFeatureProcessors

continuousFeatureProcessors

protected ContinuousFeatureProcessor[] continuousFeatureProcessors

pauseSymbol

protected java.lang.String pauseSymbol

featureDefinition

protected FeatureDefinition featureDefinition
Constructor Detail

TargetFeatureComputer

public TargetFeatureComputer(FeatureProcessorManager manager,
                             java.lang.String featureProcessorNames)
Construct a TargetFeatureComputer that knows how to compute features for a Target using the given set of feature processor names. These names must be known to the given Feature processor manager.

Parameters:
manager -
featureProcessorNames - a String containing the names of the feature processors to use, separated by white space, and in the right order (byte-valued discrete feature processors first, then short-valued, then continuous)
Method Detail

getFeatureDefinition

public FeatureDefinition getFeatureDefinition()
Provide the feature definition that can be used to interpret the feature processors generated by this TargetFeatureComputer.

Returns:

computeFeatureVector

public FeatureVector computeFeatureVector(Target target)
Using the set of feature processors defined when creating the target feature computer, compute a feature vector for the target

Parameters:
target -
Returns:
a feature vector for the target

toStringValues

public java.lang.String toStringValues(FeatureVector features)
For the given feature vector, convert each encoded value into its string representation.

Parameters:
features - a feature vector, which must match the feature processors known to this feature computer.
Returns:
a string in which the string values of all features are separated by spaces.
Throws:
java.lang.IllegalArgumentException - if the number of byte-valued, short-valued or continuous elements in features do not match the set of feature processors in this feature computer.

getByteValuedFeatureProcessors

public ByteValuedFeatureProcessor[] getByteValuedFeatureProcessors()

getShortValuedFeatureProcessors

public ShortValuedFeatureProcessor[] getShortValuedFeatureProcessors()

getContinuousFeatureProcessors

public ContinuousFeatureProcessor[] getContinuousFeatureProcessors()

getAllFeatureProcessorNames

public java.lang.String getAllFeatureProcessorNames()
List the names of all feature processors. The first line starts with "ByteValuedFeatureProcessors", followed by the list of names of the byte-valued feature processors; the second line starts with "ShortValuedFeatureProcessors", followed by the list of names of the short-valued feature processors; and the third line starts with "ContinuousFeatureProcessors", followed by the list of names of the continuous feature processors.

Returns:
a string with the names.

getByteValuedFeatureProcessorNames

public java.lang.String getByteValuedFeatureProcessorNames()
List the names of all byte-valued feature processors, separated by space characters.

Returns:
a string with the names.

getShortValuedFeatureProcessorNames

public java.lang.String getShortValuedFeatureProcessorNames()
List the names of all short-valued feature processors, separated by space characters.

Returns:
a string with the names.

getContinuousFeatureProcessorNames

public java.lang.String getContinuousFeatureProcessorNames()
List the names of all byte-valued feature processors, separated by space characters.

Returns:
a string with the names.

getAllFeatureProcessorNamesAndValues

public java.lang.String getAllFeatureProcessorNamesAndValues()
List the names and values of all feature processors. The section describing the byte-valued feature processors starts with the string "ByteValuedFeatureProcessors" in a line by itself, followed by the list of names and values of the byte-valued feature processors, as described in getByteValuedFeatureProcessorNamesAndValues(). The section describing the short-valued feature processors starts with the string "ShortValuedFeatureProcessors" in a line by itself, followed by the list of names and values of the short-valued feature processors, as described in getShortValuedFeatureProcessorNamesAndValues(). The section describing the continuous feature processors starts with the string "ContinuousFeatureProcessors" in a line by itself, followed by the list of names and values of the continuous feature processors, as described in getContinuousFeatureProcessorNamesAndValues().

Returns:
a string with the names and values.

getByteValuedFeatureProcessorNamesAndValues

public java.lang.String getByteValuedFeatureProcessorNamesAndValues()
List the names of all byte-valued feature processors and their possible values. Each line starts with the name of a feature processor, followed by the full list of string values, separated by space characters. The values are ordered so that their position corresponds to the byte value.

Returns:
a string with the names and values.

getShortValuedFeatureProcessorNamesAndValues

public java.lang.String getShortValuedFeatureProcessorNamesAndValues()
List the names of all short-valued feature processors and their possible values. Each line starts with the name of a feature processor, followed by the full list of string values, separated by space characters. The values are ordered so that their position corresponds to the short value.

Returns:
a string with the names and values.

getContinuousFeatureProcessorNamesAndValues

public java.lang.String getContinuousFeatureProcessorNamesAndValues()
List the names of all continuous feature processors and their possible values. Each line starts with the name of a feature processor, followed by the value "float" to indicate that the list of possible values is not limited.

Returns:
a string with the names and values.

getPauseSymbol

public java.lang.String getPauseSymbol()
Get the pause symbol as associated with the "phone" feature processor used.

Returns: