|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.speech.freetts.en.us.TokenToWords
Converts the Tokens (in US English words) in an Utterance into a list of words. It puts the produced list back into the Utterance. Usually, the tokens that gets expanded are numbers like "23" (to "twenty" "three").
* It translates the following code from flite:
lang/usenglish/us_text.c
Constructor Summary | |
TokenToWords(CART usNumbersCART,
PronounceableFSM prefixFSM,
PronounceableFSM suffixFSM)
Constructs a default USTokenWordProcessor. |
Method Summary | |
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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public TokenToWords(CART usNumbersCART, PronounceableFSM prefixFSM, PronounceableFSM suffixFSM)
usNumbersCART
- the cart to use to classify numbersMethod Detail |
public Item getTokenItem()
public void processUtterance(Utterance utterance) throws ProcessException
processUtterance
in interface UtteranceProcessor
utterance
- the utterance contain the tokens
ProcessException
- if an IOException is thrown during the
processing of the utterancepublic static boolean kingLike(Item tokenItem)
tokenItem
- the token item to check
public static boolean sectionLike(Item tokenItem)
tokenItem
- the token item to check
public boolean isPronounceable(java.lang.String word)
word
- the word to test
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |