public class TokenToWords extends java.lang.Object implements UtteranceProcessor
* It translates the following code from flite:
lang/usenglish/us_text.c
Constructor and Description |
---|
TokenToWords(CART usNumbersCART,
PronounceableFSM prefixFSM,
PronounceableFSM suffixFSM)
Constructs a default USTokenWordProcessor.
|
Modifier and Type | Method and Description |
---|---|
Item |
getTokenItem()
Returns the currently processing token Item.
|
boolean |
isPronounceable(java.lang.String word)
Returns true if the given word is pronounceable.
|
static boolean |
kingLike(Item tokenItem)
Returns true if the given token item contains a token that is
in a king-like context, e.g., "King" or "Louis".
|
void |
processUtterance(Utterance utterance)
process the utterance
|
static boolean |
sectionLike(Item tokenItem)
Returns true if the given token item contains a token that is
in a section-like context, e.g., "chapter" or "act".
|
java.lang.String |
toString()
Converts this object to its String representation
|
public TokenToWords(CART usNumbersCART, PronounceableFSM prefixFSM, PronounceableFSM suffixFSM)
usNumbersCART
- the cart to use to classify numberspublic Item getTokenItem()
public void processUtterance(Utterance utterance) throws ProcessException
processUtterance
in interface UtteranceProcessor
utterance
- the utterance contain the tokensProcessException
- if an IOException is thrown during the
processing of the utterancepublic static boolean kingLike(Item tokenItem)
tokenItem
- the token item to checkpublic static boolean sectionLike(Item tokenItem)
tokenItem
- the token item to checkpublic boolean isPronounceable(java.lang.String word)
word
- the word to testpublic java.lang.String toString()
toString
in class java.lang.Object