public class JPhonemiser extends InternalModule
Modifier and Type | Field and Description |
---|---|
protected AllophoneSet |
allophoneSet |
protected FSTLookup |
lexicon |
protected TeluguLTS |
lts |
protected Map<String,List<String>> |
userdict |
logger, state
MODULE_OFFLINE, MODULE_RUNNING
Constructor and Description |
---|
JPhonemiser(String propertyPrefix) |
JPhonemiser(String componentName,
MaryDataType inputType,
MaryDataType outputType,
String allophonesProperty,
String userdictProperty,
String utf8toit3mapProperty)
Constructor providing the individual filenames of files that are required.
|
Modifier and Type | Method and Description |
---|---|
String |
phonemise(String text,
String pos,
StringBuilder g2pMethod)
Phonemise the word text.
|
MaryData |
process(MaryData d)
Perform this module's processing on abstract "MaryData" input
d . |
protected Map<String,List<String>> |
readLexicon(String lexiconFilename)
Read a lexicon.
|
protected void |
setPh(Element t,
String ph) |
String |
userdictLookup(String text,
String pos)
look a given text up in the userdict.
|
getInputType, getLocale, getOutputType, getState, inputType, name, outputType, powerOnSelfTest, shutdown, startup
protected FSTLookup lexicon
protected TeluguLTS lts
protected AllophoneSet allophoneSet
public JPhonemiser(String propertyPrefix) throws IOException, MaryConfigurationException
public JPhonemiser(String componentName, MaryDataType inputType, MaryDataType outputType, String allophonesProperty, String userdictProperty, String utf8toit3mapProperty) throws IOException, MaryConfigurationException
componentName
- componentNameinputType
- inputTypeoutputType
- outputTypeallophonesProperty
- allophonesPropertyuserdictProperty
- userdictPropertyutf8toit3mapProperty
- utf8toit3mapPropertyIOException
- IOExceptionMaryConfigurationException
- MaryConfigurationExceptionpublic 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 InternalModule
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) throws IOException
text
- the textual (graphemic) form of a word.pos
- the part-of-speech of the wordg2pMethod
- 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").IOException
- IOExceptionpublic String userdictLookup(String text, String pos)
text
- IOExceptionpos
- posprotected Map<String,List<String>> readLexicon(String lexiconFilename) throws IOException
lexiconFilename
- lexiconFilenameIOException
- IOExceptionCopyright © 2000–2016 DFKI GmbH. All rights reserved.