public class JPhonemiser extends JPhonemiser
allophoneSet, lexicon, lts, punctuationPosRegex, removeTrailingOneFromPhones, unpronounceablePosRegex, userdict
logger, state
MODULE_OFFLINE, MODULE_RUNNING
Constructor and Description |
---|
JPhonemiser() |
Modifier and Type | Method and Description |
---|---|
String |
phonemise(String text,
String pos,
StringBuilder g2pMethod)
Phonemise the word text.
|
String |
phonemiseEn(String text)
Try to determine an English transcription of the text according to English rules, but using German Sampa.
|
MaryData |
process(MaryData d)
Perform this module's processing on abstract "MaryData" input
d . |
void |
shutdown()
Allow the module to shut down cleanly.
|
void |
startup()
Allow the module to start up, performing whatever is necessary to become operational.
|
getAllophoneSet, isPosPunctuation, isUnpronounceable, lexiconLookup, maybePronounceable, readLexicon, setPh, setPunctuationPosRegex, setUnpronounceablePosRegex, userdictLookup
getInputType, getLocale, getOutputType, getState, inputType, name, outputType, powerOnSelfTest
public JPhonemiser() throws IOException, MaryConfigurationException
public void startup() throws Exception
MaryModule
startup
in interface MaryModule
startup
in class JPhonemiser
Exception
- Exceptionpublic void shutdown()
MaryModule
shutdown
in interface MaryModule
shutdown
in class InternalModule
public MaryData process(MaryData d) throws Exception
InternalModule
d
. 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 MaryModule
process
in class JPhonemiser
d
- doutputType()
encapsulating the processing result.
This method just returns its input. Subclasses should override this.
Exception
- Exceptionpublic String phonemise(String text, String pos, StringBuilder g2pMethod)
phonemise
in class JPhonemiser
text
- the textual (graphemic) form of a word.pos
- posg2pMethod
- This is an awkward way to return a second String parameter via a StringBuilder. If a phonemisation of the text
is found, this parameter will be filled with the method of phonemisation ("lexicon", ... "rules").Copyright © 2000–2016 DFKI GmbH. All rights reserved.