marytts.cart
Class StringPredictionTree

java.lang.Object
  extended by marytts.cart.DirectedGraph
      extended by marytts.cart.CART
          extended by marytts.cart.StringPredictionTree

public class StringPredictionTree
extends CART


Field Summary
static java.lang.String ENC_LINE_END
           
static java.lang.String ENC_LINE_START
           
 
Fields inherited from class marytts.cart.DirectedGraph
featDef, logger, properties, rootNode
 
Constructor Summary
StringPredictionTree(java.io.BufferedReader reader, FeatureDefinition featDefinition)
          This constructs a new string prediciton tree from a stream containing a tree in wagon format.
StringPredictionTree(Node aRootNode, FeatureDefinition aFeatDef, java.lang.String[] aTargetDecoding)
           
 
Method Summary
 java.lang.String getMostProbableString(FeatureVector aFV)
           
 java.lang.String getMostProbableString(Target aTarget)
           
 Node interpretToNode(FeatureVector featureVector, int minNumberOfData)
          TODO: copied from CART, does not work as expected with minNumberOfData = 0 Passes the given item through this CART and returns the leaf Node, or the Node it stopped walking down.
 java.lang.String toString()
           
 
Methods inherited from class marytts.cart.CART
interpret, interpretToNode, replaceLeafByCart
 
Methods inherited from class marytts.cart.DirectedGraph
getDecisionNodeIterator, getDecisionNodes, getDirectedGraphNodeIterator, getDirectedGraphNodes, getFeatureDefinition, getLeafNodeIterator, getLeafNodes, getNodeIterator, getNodes, getNumNodes, getProperties, getRootNode, interpret, interpret, interpret, setRootNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ENC_LINE_START

public static final java.lang.String ENC_LINE_START
See Also:
Constant Field Values

ENC_LINE_END

public static final java.lang.String ENC_LINE_END
See Also:
Constant Field Values
Constructor Detail

StringPredictionTree

public StringPredictionTree(Node aRootNode,
                            FeatureDefinition aFeatDef,
                            java.lang.String[] aTargetDecoding)
Parameters:
rootNode - the root node of this tree. This node has to be set to be a root node beforehand.
featDef - the featureDefinition used in this tree

StringPredictionTree

public StringPredictionTree(java.io.BufferedReader reader,
                            FeatureDefinition featDefinition)
                     throws java.io.IOException
This constructs a new string prediciton tree from a stream containing a tree in wagon format. In addition to the constructor of ExtendedClassificationTree it reads in the mapping from numbers to the Strings from a stream. The encoding has to be the first line in the file (a empty line is allowed). It has the form: ;;target={1:'string_a',2:'string_b,'...',26:'string_z'}

Throws:
java.io.IOException
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class DirectedGraph

interpretToNode

public Node interpretToNode(FeatureVector featureVector,
                            int minNumberOfData)
TODO: copied from CART, does not work as expected with minNumberOfData = 0 Passes the given item through this CART and returns the leaf Node, or the Node it stopped walking down.

Overrides:
interpretToNode in class CART
Parameters:
target - the target to analyze
minNumberOfData - the minimum number of data requested. If this is 0, walk down the CART until the leaf level.
Returns:
the Node

getMostProbableString

public java.lang.String getMostProbableString(FeatureVector aFV)

getMostProbableString

public java.lang.String getMostProbableString(Target aTarget)