marytts.tools.voiceimport
Class CARTBuilder

java.lang.Object
  extended by marytts.tools.voiceimport.VoiceImportComponent
      extended by marytts.tools.voiceimport.CARTBuilder

public class CARTBuilder
extends VoiceImportComponent


Nested Class Summary
static class CARTBuilder.WagonCallerThread
           
 
Field Summary
 java.lang.String ACFEATUREFILE
           
 java.lang.String CALLWAGON
           
 java.lang.String CARTFILE
           
 java.lang.String ESTDIR
           
 java.lang.String FEATURESEQFILE
           
 java.lang.String MAXLEAFSIZE
           
 java.lang.String MCEPTIMELINE
           
 java.lang.String NUMPROCESSES
           
 java.lang.String READFEATURESEQUENCE
           
 java.lang.String TOPLEVELTREEFILE
           
 java.lang.String UNITFILE
           
 
Fields inherited from class marytts.tools.voiceimport.VoiceImportComponent
bnl, logger, props, props2Help
 
Constructor Summary
CARTBuilder()
           
 
Method Summary
 void buildAndDumpDistanceTables(FeatureVector[] featureVectors, java.lang.String filename, FeatureDefinition featDef)
          Build the distance tables for the units from which we have the feature vectors and dump them to a file with the given filename
 boolean compute()
          Do the computations required by this component.
 void dumpFeatureVectors(FeatureVector[] featureVectors, FeatureDefinition featDef, java.lang.String filename)
          Dump the given feature vectors to a file with the given filename
 java.util.SortedMap<java.lang.String,java.lang.String> getDefaultProps(DatabaseLayout theDb)
          Get the map of properties2values containing the default values
 java.lang.String getName()
          Get the name of this component
 int getProgress()
          Provide the progress of computation, in percent, or -1 if that feature is not implemented.
 CART importCART(java.lang.String filename, FeatureDefinition featDef)
          Read in the CARTs from festival/trees/ directory, and store them in a CARTMap
 void initialiseComp()
          Initialise a voice import component: component specific initialisation; to be overwritten by subclasses
static void main(java.lang.String[] args)
           
 boolean replaceLeaves(CART cart, FeatureDefinition featureDefinition)
          For each leaf in the CART, run Wagon on the feature vectors in this CART, and replace leaf by resulting CART
protected  void setupHelp()
           
 
Methods inherited from class marytts.tools.voiceimport.VoiceImportComponent
getHelpText, getHelpTextForProp, getProp, initialise, setProp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACFEATUREFILE

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

FEATURESEQFILE

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

TOPLEVELTREEFILE

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

CARTFILE

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

MCEPTIMELINE

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

UNITFILE

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

READFEATURESEQUENCE

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

MAXLEAFSIZE

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

CALLWAGON

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

ESTDIR

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

NUMPROCESSES

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

CARTBuilder

public CARTBuilder()
Method Detail

getName

public java.lang.String getName()
Description copied from class: VoiceImportComponent
Get the name of this component

Specified by:
getName in class VoiceImportComponent
Returns:
the name

initialiseComp

public void initialiseComp()
Description copied from class: VoiceImportComponent
Initialise a voice import component: component specific initialisation; to be overwritten by subclasses

Overrides:
initialiseComp in class VoiceImportComponent

getDefaultProps

public java.util.SortedMap<java.lang.String,java.lang.String> getDefaultProps(DatabaseLayout theDb)
Description copied from class: VoiceImportComponent
Get the map of properties2values containing the default values

Specified by:
getDefaultProps in class VoiceImportComponent
Returns:
map of props2values

setupHelp

protected void setupHelp()
Specified by:
setupHelp in class VoiceImportComponent

compute

public boolean compute()
                throws java.lang.Exception
Description copied from class: VoiceImportComponent
Do the computations required by this component.

Specified by:
compute in class VoiceImportComponent
Returns:
true on success, false on failure
Throws:
java.lang.Exception

importCART

public CART importCART(java.lang.String filename,
                       FeatureDefinition featDef)
                throws java.io.IOException
Read in the CARTs from festival/trees/ directory, and store them in a CARTMap

Parameters:
festvoxDirectory - the festvox directory of a voice
Throws:
java.io.IOException

replaceLeaves

public boolean replaceLeaves(CART cart,
                             FeatureDefinition featureDefinition)
                      throws java.io.IOException
For each leaf in the CART, run Wagon on the feature vectors in this CART, and replace leaf by resulting CART

Parameters:
topLevelCART - the CART
featureDefinition - the definition of the features
Throws:
java.io.IOException

dumpFeatureVectors

public void dumpFeatureVectors(FeatureVector[] featureVectors,
                               FeatureDefinition featDef,
                               java.lang.String filename)
                        throws java.io.FileNotFoundException
Dump the given feature vectors to a file with the given filename

Parameters:
featureVectors - the feature vectors
featDef - the feature definition
filename - the filename
Throws:
java.io.FileNotFoundException

buildAndDumpDistanceTables

public void buildAndDumpDistanceTables(FeatureVector[] featureVectors,
                                       java.lang.String filename,
                                       FeatureDefinition featDef)
                                throws java.io.IOException
Build the distance tables for the units from which we have the feature vectors and dump them to a file with the given filename

Parameters:
featureVectors - the feature vectors of the units
filename - the filename
Throws:
java.io.IOException

getProgress

public int getProgress()
Provide the progress of computation, in percent, or -1 if that feature is not implemented.

Specified by:
getProgress in class VoiceImportComponent
Returns:
-1 if not implemented, or an integer between 0 and 100.

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception