marytts.modules
Class PronunciationModel

java.lang.Object
  extended by marytts.modules.InternalModule
      extended by marytts.modules.PronunciationModel
All Implemented Interfaces:
MaryModule
Direct Known Subclasses:
Postlex, PronunciationModel

public class PronunciationModel
extends InternalModule

This module serves as a post-lexical pronunciation model. Its appropriate place in the module chain is after intonisation. The target features are taken and fed into decision trees that predict the new pronunciation. A new mary xml is output, with the difference being that the old pronunciation is replaced by the newly predicted one, and a finer grained xml structure.

Author:
ben

Field Summary
 
Fields inherited from class marytts.modules.InternalModule
logger, state
 
Fields inherited from interface marytts.modules.MaryModule
MODULE_OFFLINE, MODULE_RUNNING
 
Constructor Summary
PronunciationModel()
          Constructor, stating that the input is of type INTONATION, the output of type ALLOPHONES.
PronunciationModel(java.util.Locale locale)
           
 
Method Summary
protected  boolean postlexicalRules(org.w3c.dom.Element token, AllophoneSet allophoneSet)
          Optionally, a language-specific subclass can implement any postlexical rules on the document.
 MaryData process(MaryData d)
          This computes a new pronunciation for the elements of some MaryData, that is phonemised.
 void startup()
          Allow the module to start up, performing whatever is necessary to become operational.
protected  void updatePhAttributesFromPhElements(org.w3c.dom.Element token)
           
 
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

PronunciationModel

public PronunciationModel()
Constructor, stating that the input is of type INTONATION, the output of type ALLOPHONES.


PronunciationModel

public PronunciationModel(java.util.Locale locale)
Method Detail

startup

public void startup()
             throws java.lang.Exception
Description copied from interface: MaryModule
Allow the module to start up, performing whatever is necessary to become operational. After successful completion, getState() should return MODULE_RUNNING.

Specified by:
startup in interface MaryModule
Overrides:
startup in class InternalModule
Throws:
java.lang.Exception

postlexicalRules

protected boolean postlexicalRules(org.w3c.dom.Element token,
                                   AllophoneSet allophoneSet)
Optionally, a language-specific subclass can implement any postlexical rules on the document.

Parameters:
token - a element with a and substructure.
allophoneSet -
Returns:
true if something was changed, false otherwise

process

public MaryData process(MaryData d)
                 throws java.lang.Exception
This computes a new pronunciation for the elements of some MaryData, that is phonemised.

Specified by:
process in interface MaryModule
Overrides:
process in class InternalModule
Returns:
A MaryData object of type outputType() encapsulating the processing result.

This method just returns its input. Subclasses should override this.

Throws:
java.lang.Exception

updatePhAttributesFromPhElements

protected void updatePhAttributesFromPhElements(org.w3c.dom.Element token)