|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmarytts.modules.InternalModule
marytts.modules.Utt2XMLBase
public abstract class Utt2XMLBase
Convert FreeTTS utterances into MaryXML format. This abstract base class is to provide the common part for all Utterance to MaryXML converters.
| Field Summary | |
|---|---|
protected javax.xml.parsers.DocumentBuilder |
docBuilder
|
protected javax.xml.parsers.DocumentBuilderFactory |
factory
|
| Fields inherited from class marytts.modules.InternalModule |
|---|
logger, state |
| Fields inherited from interface marytts.modules.MaryModule |
|---|
MODULE_OFFLINE, MODULE_RUNNING |
| Constructor Summary | |
|---|---|
Utt2XMLBase(java.lang.String name,
MaryDataType input,
MaryDataType output,
java.util.Locale locale)
|
|
| Method Summary | |
|---|---|
protected void |
fillSentence(org.w3c.dom.Element sentence,
com.sun.speech.freetts.Utterance utterance)
Depending on the data type, find the right information in the utterance and insert it into the sentence. |
protected org.w3c.dom.Element |
insertProsodySettings(org.w3c.dom.Element insertHere,
com.sun.speech.freetts.FeatureSet featureSet)
For a given utterance or token, see if there are any prosodic settings defined, and if so, create a corresponding prosody element as a child of insertHere. |
protected java.lang.String |
insertSegment(com.sun.speech.freetts.Item segmentItem,
org.w3c.dom.Element syllable,
boolean deep)
Convert an item in the Segment relation into XML, inserting it at the specified location in the XML tree. |
protected java.lang.String |
insertSyllable(com.sun.speech.freetts.Item syllableItem,
org.w3c.dom.Element token,
boolean deep)
Convert an item in the Syllable relation into XML, inserting it at the specified location in the XML tree. |
protected void |
insertToken(com.sun.speech.freetts.Item tokenItem,
org.w3c.dom.Element parent)
Convert an item in the Token relation into XML, inserting it at the specified location in the XML tree. |
protected void |
insertToken(com.sun.speech.freetts.Item tokenItem,
org.w3c.dom.Element parent,
boolean deep)
Convert an item in the Token relation into XML, inserting it at the specified location in the XML tree. |
java.lang.String |
phoneArray2phoneString(AllophoneSet allophoneSet,
java.lang.String[] voicePhones)
Converts an array of phone symbol strings into a single phone string. |
MaryData |
process(MaryData d)
Perform this module's processing on abstract "MaryData" input d. |
void |
startup()
Allow the module to start up, performing whatever is necessary to become operational. |
| Methods inherited from class marytts.modules.InternalModule |
|---|
getLocale, getState, inputType, name, outputType, powerOnSelfTest, shutdown |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected javax.xml.parsers.DocumentBuilderFactory factory
protected javax.xml.parsers.DocumentBuilder docBuilder
| Constructor Detail |
|---|
public Utt2XMLBase(java.lang.String name,
MaryDataType input,
MaryDataType output,
java.util.Locale locale)
| Method Detail |
|---|
public void startup()
throws java.lang.Exception
MaryModule
startup in interface MaryModulestartup in class InternalModulejava.lang.Exception
public MaryData process(MaryData d)
throws java.lang.Exception
InternalModuled.
Subclasses need to make sure that the process()
method is thread-safe, because in server-mode,
it will be called from different threads at the same time.
A sensible way to do this seems to be not to use any
global or static variables, or to use them read-only.
process in interface MaryModuleprocess in class InternalModuleoutputType() encapsulating the processing result.
This method just returns its input. Subclasses should override this.
java.lang.Exception
protected final void fillSentence(org.w3c.dom.Element sentence,
com.sun.speech.freetts.Utterance utterance)
protected void insertToken(com.sun.speech.freetts.Item tokenItem,
org.w3c.dom.Element parent)
protected void insertToken(com.sun.speech.freetts.Item tokenItem,
org.w3c.dom.Element parent,
boolean deep)
deep - whether to create a deep structure of
protected java.lang.String insertSyllable(com.sun.speech.freetts.Item syllableItem,
org.w3c.dom.Element token,
boolean deep)
deep - whether to create a deep structure of
protected java.lang.String insertSegment(com.sun.speech.freetts.Item segmentItem,
org.w3c.dom.Element syllable,
boolean deep)
deep - whether to create a deep structure of
protected org.w3c.dom.Element insertProsodySettings(org.w3c.dom.Element insertHere,
com.sun.speech.freetts.FeatureSet featureSet)
featureSet - an utterance, optionally containing prosody settingsinsertHere - an element into which to insert the new prosody element if required.
public java.lang.String phoneArray2phoneString(AllophoneSet allophoneSet,
java.lang.String[] voicePhones)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||