|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmarytts.modules.InternalModule
marytts.language.tib.Phonemiser
public class Phonemiser
The Tibetan Phonemiser First checks, if the tokens are defined in the lexicon (lexicon_tib.txt) If not, letter-to-sound rules (defined in syllableRules.xml) are applied Created on 24.05.2005
| Field Summary |
|---|
| Fields inherited from class marytts.modules.InternalModule |
|---|
logger, state |
| Fields inherited from interface marytts.modules.MaryModule |
|---|
MODULE_OFFLINE, MODULE_RUNNING |
| Constructor Summary | |
|---|---|
Phonemiser()
Constructor |
|
| Method Summary | |
|---|---|
java.lang.String |
act(org.w3c.dom.Element action,
org.w3c.dom.Element syllable)
Carry out the action specified in an action-node |
java.lang.String |
applyRules(org.w3c.dom.Element e,
org.w3c.dom.Element syllable,
org.w3c.dom.Element nextSyl,
org.w3c.dom.Element prevSyl,
int sylpos,
int maxsyl)
Find the first rule that matches and apply it |
void |
buildDefinitions()
Read in the general definitions of wylie-symbols, sampa-symbols and conditions |
void |
buildLexicon()
Build the lexicon |
boolean |
checkAttributes(org.w3c.dom.Element attributes,
org.w3c.dom.Element syllable)
Look at an attributes-node and determine if its specifications match to the syllable |
boolean |
checkCondition(org.w3c.dom.Element condition,
org.w3c.dom.Element syllable,
int sylpos,
int maxsyl)
Determine if the conditions in a condition-node are fulfilled by a syllable |
void |
checkSampaDef(java.lang.String num,
java.lang.String sampa,
java.util.HashSet atts)
Check a sampa definition of an action node |
java.lang.String[] |
lookUp(java.lang.String text)
Look up a token in the lexicon |
MaryData |
process(MaryData d)
Process the data |
void |
processToken(org.w3c.dom.Element token)
process a token of the data |
void |
startup()
Read in the data of the xml file; test if list, maps and rules are correct; build the lexicon |
void |
testFailAction(org.w3c.dom.Element act,
java.lang.String num,
java.util.HashSet atts)
Test, if an action node is correct |
java.util.HashSet |
testFailAttributes(org.w3c.dom.Element att,
java.lang.String num)
Test, if the attributes node is correct Is also used for nextattributes and prevattributes |
void |
testFailCondition(org.w3c.dom.Element cond,
java.lang.String num)
Test, if a condition node is correct |
void |
testFailDefinitions()
Test, if the lists and maps in the definitions-section are correct |
void |
testFailRules(org.w3c.dom.NodeList rules)
Test, if the rules in the NodeList are correct |
| 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 |
| Constructor Detail |
|---|
public Phonemiser()
| Method Detail |
|---|
public void startup()
throws java.lang.Exception
startup in interface MaryModulestartup in class InternalModulean - Exception, if there are Errors in the xml file
java.lang.Exceptionpublic void buildDefinitions()
public void testFailDefinitions()
IllegalArgumentException, - if the definitions are not correctpublic void testFailRules(org.w3c.dom.NodeList rules)
rules - the NodeList of rules
IllegalArgumentException, - if there is a rule without a number
public java.util.HashSet testFailAttributes(org.w3c.dom.Element att,
java.lang.String num)
att - the attributes nodenum - the number of the rule
IllegalArgumentException, - if the attributes node is not correct
public void testFailCondition(org.w3c.dom.Element cond,
java.lang.String num)
cond - the condition nodenum - the number of the rule
IllegalArgumentException, - if the condition node is not correct
public void testFailAction(org.w3c.dom.Element act,
java.lang.String num,
java.util.HashSet atts)
act - the action nodenum - the number of the ruleatts - the attributes of the attributes node of the rule
IllegalArgumentException, - if the action node is not correct
public void checkSampaDef(java.lang.String num,
java.lang.String sampa,
java.util.HashSet atts)
throws java.lang.IllegalArgumentException
num - the name of the current rulesampa - the sampa definitionatts - the attributes of the rule (from attribute node)
java.lang.IllegalArgumentException - if definition not correct
public void buildLexicon()
throws java.lang.Exception
java.lang.Exception - if there are problems reading the file
public MaryData process(MaryData d)
throws java.lang.Exception
process in interface MaryModuleprocess in class InternalModuled - the data to be processed
java.lang.Exceptionpublic void processToken(org.w3c.dom.Element token)
token - the syllable to be processedpublic java.lang.String[] lookUp(java.lang.String text)
text - the text of the token
public java.lang.String applyRules(org.w3c.dom.Element e,
org.w3c.dom.Element syllable,
org.w3c.dom.Element nextSyl,
org.w3c.dom.Element prevSyl,
int sylpos,
int maxsyl)
e - the element that contains the rulessyllable - the syllable to be processedsylpos - the position of the syllable in the word (0 to maxsyl)maxsyl - the number of syllables in the word (starting with 0)
public boolean checkAttributes(org.w3c.dom.Element attributes,
org.w3c.dom.Element syllable)
attributes - the attributes-nodesyllable - the syllable to be matched
public boolean checkCondition(org.w3c.dom.Element condition,
org.w3c.dom.Element syllable,
int sylpos,
int maxsyl)
condition - the condition-nodesyllable - the syllablesylpos - the position of the syllable in the word (0 to maxsyl)maxsyl - the number of syllables in the word (starting with 0)
public java.lang.String act(org.w3c.dom.Element action,
org.w3c.dom.Element syllable)
action - the action-nodesyllable - the syllable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||