|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.dfki.lt.mary.modules.InternalModule
de.dfki.lt.mary.modules.XML2UttBase
public abstract class XML2UttBase
Convert a MaryXML DOM tree into FreeTTS utterances. This abstract base class is to provide the common part for all MaryXML to Utterance converters.
| Field Summary | |
|---|---|
protected int |
lastTargetIndex
|
protected int |
nextTargetIndex
|
| Fields inherited from class de.dfki.lt.mary.modules.InternalModule |
|---|
logger, state |
| Fields inherited from interface de.dfki.lt.mary.modules.MaryModule |
|---|
MODULE_OFFLINE, MODULE_RUNNING |
| Constructor Summary | |
|---|---|
XML2UttBase(java.lang.String name,
MaryDataType input,
MaryDataType output)
|
|
| Method Summary | |
|---|---|
protected java.lang.String |
addOneElement(com.sun.speech.freetts.Utterance utterance,
org.w3c.dom.Element element,
boolean createWordRelation,
boolean createSylStructRelation,
boolean createTargetRelation)
To a given utterance in which relations have already been created appropriately, add a single boundary, t or mtu element. |
protected com.sun.speech.freetts.Item |
appendTokenItem(com.sun.speech.freetts.Relation tokenRelation,
java.lang.String tokenText)
Append one item to the token relation, and return it. |
protected com.sun.speech.freetts.Item |
createSylStructure(com.sun.speech.freetts.Item wordItem,
org.w3c.dom.Element t,
boolean createTargetRelation)
|
protected abstract void |
fillUtterance(com.sun.speech.freetts.Utterance utterance,
org.w3c.dom.Element sentence)
Depending on the data type, find the right information in the sentence and insert it into the utterance. |
protected void |
fillUtterance(com.sun.speech.freetts.Utterance utterance,
org.w3c.dom.Element sentence,
boolean createWordRelation,
boolean createSylStructRelation,
boolean createTargetRelation)
Depending on the data type, find the right information in the sentence and insert it into the utterance. |
protected com.sun.speech.freetts.Item |
insertWordItem(com.sun.speech.freetts.Relation wordRelation,
com.sun.speech.freetts.Relation phraseRelation,
com.sun.speech.freetts.Item tokenItem,
org.w3c.dom.Element wordElement)
|
MaryData |
process(MaryData d)
Perform this module's processing on abstract "MaryData" input d. |
protected java.lang.String |
searchFollowingMarks(org.w3c.dom.Element element)
Search forewards for mark elements
that occur between the given element and the preceding (if any) element
with the same tagname. |
protected java.lang.String |
searchFollowingMarks(org.w3c.dom.Element element,
java.lang.String[] tagnames)
Search forewards for mark elements
that occur between the given element and the preceding (if any) element
with one of the given tagnames. |
protected java.lang.String |
searchPrecedingMarks(org.w3c.dom.Element element)
Search backwards for mark elements
that occur between the given element and the preceding (if any) element
with the same tagname. |
protected java.lang.String |
searchPrecedingMarks(org.w3c.dom.Element element,
java.lang.String[] tagnames)
Search backwards for mark elements
that occur between the given element and the preceding (if any) element
with one of the given tagnames. |
void |
startup()
Allow the module to start up, performing whatever is necessary to become operational. |
| Methods inherited from class de.dfki.lt.mary.modules.InternalModule |
|---|
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 int lastTargetIndex
protected int nextTargetIndex
| Constructor Detail |
|---|
public XML2UttBase(java.lang.String name,
MaryDataType input,
MaryDataType output)
| 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 abstract void fillUtterance(com.sun.speech.freetts.Utterance utterance,
org.w3c.dom.Element sentence)
protected void fillUtterance(com.sun.speech.freetts.Utterance utterance,
org.w3c.dom.Element sentence,
boolean createWordRelation,
boolean createSylStructRelation,
boolean createTargetRelation)
protected java.lang.String addOneElement(com.sun.speech.freetts.Utterance utterance,
org.w3c.dom.Element element,
boolean createWordRelation,
boolean createSylStructRelation,
boolean createTargetRelation)
utterance - element - createWordRelation - createSylStructRelation - createTargetRelation -
protected com.sun.speech.freetts.Item appendTokenItem(com.sun.speech.freetts.Relation tokenRelation,
java.lang.String tokenText)
tokenRelation - tokenText -
protected com.sun.speech.freetts.Item insertWordItem(com.sun.speech.freetts.Relation wordRelation,
com.sun.speech.freetts.Relation phraseRelation,
com.sun.speech.freetts.Item tokenItem,
org.w3c.dom.Element wordElement)
protected com.sun.speech.freetts.Item createSylStructure(com.sun.speech.freetts.Item wordItem,
org.w3c.dom.Element t,
boolean createTargetRelation)
protected java.lang.String searchPrecedingMarks(org.w3c.dom.Element element)
mark elements
that occur between the given element and the preceding (if any) element
with the same tagname.
element -
protected java.lang.String searchPrecedingMarks(org.w3c.dom.Element element,
java.lang.String[] tagnames)
mark elements
that occur between the given element and the preceding (if any) element
with one of the given tagnames.
element - tagnames -
protected java.lang.String searchFollowingMarks(org.w3c.dom.Element element)
mark elements
that occur between the given element and the preceding (if any) element
with the same tagname.
element -
protected java.lang.String searchFollowingMarks(org.w3c.dom.Element element,
java.lang.String[] tagnames)
mark elements
that occur between the given element and the preceding (if any) element
with one of the given tagnames.
element - tagnames -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||