marytts.htsengine
Class PhoneTranslator

java.lang.Object
  extended by marytts.htsengine.PhoneTranslator

public class PhoneTranslator
extends java.lang.Object

Translates phone names used in HTS-HTK


Constructor Summary
PhoneTranslator(java.lang.String trickyPhonesFile)
           
 
Method Summary
 java.lang.String features2context(FeatureDefinition def, FeatureVector featureVector, java.util.Vector<java.lang.String> featureList)
          Convert the feature vector into a context model name to be used by HTS/HTK.
 java.lang.String features2LongContext(FeatureDefinition def, FeatureVector featureVector, java.util.Vector<java.lang.String> featureList)
          Convert the feature vector into a context model name to be used by HTS/HTK.
static void main(java.lang.String[] args)
           
 java.lang.String replaceBackPunc(java.lang.String lab)
           
 java.lang.String replaceBackToBI(java.lang.String lab)
           
 java.lang.String replaceBackTrickyPhones(java.lang.String lab)
          Translation table for labels which are incompatible with HTK or shell filenames See common_routines.pl in HTS training.
 java.lang.String replacePunc(java.lang.String lab)
           
 java.lang.String replaceToBI(java.lang.String lab)
           
 java.lang.String replaceTrickyPhones(java.lang.String lab)
          Translation table for labels which are incompatible with HTK or shell filenames See common_routines.pl in HTS training.
 void setContextFeatureFile(java.lang.String str)
           
 java.lang.String shortenPfeat(java.lang.String fea)
          Shorten the key name (to make the full context names shorter) See common_routines.pl in HTS training.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhoneTranslator

public PhoneTranslator(java.lang.String trickyPhonesFile)
                throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException
Method Detail

setContextFeatureFile

public void setContextFeatureFile(java.lang.String str)

features2context

public java.lang.String features2context(FeatureDefinition def,
                                         FeatureVector featureVector,
                                         java.util.Vector<java.lang.String> featureList)
Convert the feature vector into a context model name to be used by HTS/HTK.

Parameters:
def - a feature definition
featureVector - a feature vector which must be consistent with the Feature definition
featureList - a list of features to use in constructing the context model name. If missing, all features in the feature definition are used.
Returns:
the string representation of one context name. NOTE: is this function used somewhere? CHECK!

features2LongContext

public java.lang.String features2LongContext(FeatureDefinition def,
                                             FeatureVector featureVector,
                                             java.util.Vector<java.lang.String> featureList)
Convert the feature vector into a context model name to be used by HTS/HTK.

Parameters:
def - a feature definition
featureVector - a feature vector which must be consistent with the Feature definition
featureList - a list of features to use in constructing the context model name. If missing, all features in the feature definition are used.
Returns:
the string representation of one context name.

replaceTrickyPhones

public java.lang.String replaceTrickyPhones(java.lang.String lab)
Translation table for labels which are incompatible with HTK or shell filenames See common_routines.pl in HTS training.

Parameters:
lab -
Returns:
String

replaceBackTrickyPhones

public java.lang.String replaceBackTrickyPhones(java.lang.String lab)
Translation table for labels which are incompatible with HTK or shell filenames See common_routines.pl in HTS training. In this function the phones as used internally in HTSEngine are changed back to the Mary TTS set, this function is necessary when correcting the actual durations of AcousticPhonemes.

Parameters:
lab -
Returns:
String

shortenPfeat

public java.lang.String shortenPfeat(java.lang.String fea)
Shorten the key name (to make the full context names shorter) See common_routines.pl in HTS training. not needed CHECK


replacePunc

public java.lang.String replacePunc(java.lang.String lab)

replaceBackPunc

public java.lang.String replaceBackPunc(java.lang.String lab)

replaceToBI

public java.lang.String replaceToBI(java.lang.String lab)

replaceBackToBI

public java.lang.String replaceBackToBI(java.lang.String lab)

main

public static void main(java.lang.String[] args)