1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
\r
5 <!-- Generated by javadoc (build 1.4.2_16) on Mon Mar 09 18:20:30 CET 2009 -->
\r
7 TokenToWords (FreeTTS 1.2)
\r
10 <META NAME="keywords" CONTENT="com.sun.speech.freetts.en.us.TokenToWords class">
\r
12 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">
\r
14 <SCRIPT type="text/javascript">
\r
15 function windowTitle()
\r
17 parent.document.title="TokenToWords (FreeTTS 1.2)";
\r
23 <BODY BGCOLOR="white" onload="windowTitle();">
\r
26 <!-- ========= START OF TOP NAVBAR ======= -->
\r
27 <A NAME="navbar_top"><!-- --></A>
28 <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
29 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
\r
31 <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
\r
32 <A NAME="navbar_top_firstrow"><!-- --></A>
33 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
\r
34 <TR ALIGN="center" VALIGN="top">
\r
35 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
\r
36 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
\r
37 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
\r
38 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
\r
39 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
\r
40 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
\r
41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
\r
45 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
\r
51 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
\r
52 <A HREF="../../../../../../com/sun/speech/freetts/en/us/SuffixFSM.html" title="class in com.sun.speech.freetts.en.us"><B>PREV CLASS</B></A>
\r
53 <A HREF="../../../../../../com/sun/speech/freetts/en/us/USEnglish.html" title="class in com.sun.speech.freetts.en.us"><B>NEXT CLASS</B></A></FONT></TD>
\r
54 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
\r
55 <A HREF="../../../../../../index.html" target="_top"><B>FRAMES</B></A>
\r
56 <A HREF="TokenToWords.html" target="_top"><B>NO FRAMES</B></A>
\r
57 <SCRIPT type="text/javascript">
\r
60 document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
\r
65 <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
\r
71 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
\r
72 SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
\r
73 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
\r
74 DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
\r
77 <A NAME="skip-navbar_top"></A>
78 <!-- ========= END OF TOP NAVBAR ========= -->
\r
81 <!-- ======== START OF CLASS DATA ======== -->
\r
84 com.sun.speech.freetts.en.us</FONT>
\r
86 Class TokenToWords</H2>
\r
89 <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by"><B>com.sun.speech.freetts.en.us.TokenToWords</B>
\r
92 <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../../../com/sun/speech/freetts/UtteranceProcessor.html" title="interface in com.sun.speech.freetts">UtteranceProcessor</A></DD>
\r
96 <DT>public class <B>TokenToWords</B><DT>extends java.lang.Object<DT>implements <A HREF="../../../../../../com/sun/speech/freetts/UtteranceProcessor.html" title="interface in com.sun.speech.freetts">UtteranceProcessor</A></DL>
\r
99 Converts the Tokens (in US English words) in an
100 Utterance into a list of words. It puts the produced list back
101 into the Utterance. Usually, the tokens that gets expanded are numbers
102 like "23" (to "twenty" "three").
103 <p> * It translates the following code from flite:
106 lang/usenglish/us_text.c
114 <!-- ======== NESTED CLASS SUMMARY ======== -->
\r
117 <!-- =========== FIELD SUMMARY =========== -->
\r
120 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
\r
122 <A NAME="constructor_summary"><!-- --></A>
123 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
124 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
125 <TD COLSPAN=2><FONT SIZE="+2">
\r
126 <B>Constructor Summary</B></FONT></TD>
\r
128 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
129 <TD><CODE><B><A HREF="../../../../../../com/sun/speech/freetts/en/us/TokenToWords.html#TokenToWords(com.sun.speech.freetts.cart.CART, com.sun.speech.freetts.en.us.PronounceableFSM, com.sun.speech.freetts.en.us.PronounceableFSM)">TokenToWords</A></B>(<A HREF="../../../../../../com/sun/speech/freetts/cart/CART.html" title="interface in com.sun.speech.freetts.cart">CART</A> usNumbersCART,
130 <A HREF="../../../../../../com/sun/speech/freetts/en/us/PronounceableFSM.html" title="class in com.sun.speech.freetts.en.us">PronounceableFSM</A> prefixFSM,
131 <A HREF="../../../../../../com/sun/speech/freetts/en/us/PronounceableFSM.html" title="class in com.sun.speech.freetts.en.us">PronounceableFSM</A> suffixFSM)</CODE>
\r
134 Constructs a default USTokenWordProcessor. </TD>
\r
138 <!-- ========== METHOD SUMMARY =========== -->
\r
140 <A NAME="method_summary"><!-- --></A>
141 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
142 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
143 <TD COLSPAN=2><FONT SIZE="+2">
\r
144 <B>Method Summary</B></FONT></TD>
\r
146 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
147 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
148 <CODE> <A HREF="../../../../../../com/sun/speech/freetts/Item.html" title="class in com.sun.speech.freetts">Item</A></CODE></FONT></TD>
\r
149 <TD><CODE><B><A HREF="../../../../../../com/sun/speech/freetts/en/us/TokenToWords.html#getTokenItem()">getTokenItem</A></B>()</CODE>
\r
152 Returns the currently processing token Item.</TD>
\r
154 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
155 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
156 <CODE> boolean</CODE></FONT></TD>
\r
157 <TD><CODE><B><A HREF="../../../../../../com/sun/speech/freetts/en/us/TokenToWords.html#isPronounceable(java.lang.String)">isPronounceable</A></B>(java.lang.String word)</CODE>
\r
160 Returns true if the given word is pronounceable.
163 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
164 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
165 <CODE>static boolean</CODE></FONT></TD>
\r
166 <TD><CODE><B><A HREF="../../../../../../com/sun/speech/freetts/en/us/TokenToWords.html#kingLike(com.sun.speech.freetts.Item)">kingLike</A></B>(<A HREF="../../../../../../com/sun/speech/freetts/Item.html" title="class in com.sun.speech.freetts">Item</A> tokenItem)</CODE>
\r
169 Returns true if the given token item contains a token that is
170 in a king-like context, e.g., "King" or "Louis".</TD>
\r
172 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
173 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
174 <CODE> void</CODE></FONT></TD>
\r
175 <TD><CODE><B><A HREF="../../../../../../com/sun/speech/freetts/en/us/TokenToWords.html#processUtterance(com.sun.speech.freetts.Utterance)">processUtterance</A></B>(<A HREF="../../../../../../com/sun/speech/freetts/Utterance.html" title="class in com.sun.speech.freetts">Utterance</A> utterance)</CODE>
\r
178 process the utterance</TD>
\r
180 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
181 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
182 <CODE>static boolean</CODE></FONT></TD>
\r
183 <TD><CODE><B><A HREF="../../../../../../com/sun/speech/freetts/en/us/TokenToWords.html#sectionLike(com.sun.speech.freetts.Item)">sectionLike</A></B>(<A HREF="../../../../../../com/sun/speech/freetts/Item.html" title="class in com.sun.speech.freetts">Item</A> tokenItem)</CODE>
\r
186 Returns true if the given token item contains a token that is
187 in a section-like context, e.g., "chapter" or "act".</TD>
\r
189 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
190 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
191 <CODE> java.lang.String</CODE></FONT></TD>
\r
192 <TD><CODE><B><A HREF="../../../../../../com/sun/speech/freetts/en/us/TokenToWords.html#toString()">toString</A></B>()</CODE>
\r
195 Converts this object to its String representation</TD>
\r
198 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
199 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
200 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
\r
201 <TD><B>Methods inherited from class java.lang.Object</B></TD>
\r
203 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
204 <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD>
\r
210 <!-- ============ FIELD DETAIL =========== -->
\r
213 <!-- ========= CONSTRUCTOR DETAIL ======== -->
\r
215 <A NAME="constructor_detail"><!-- --></A>
216 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
217 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
218 <TD COLSPAN=1><FONT SIZE="+2">
\r
219 <B>Constructor Detail</B></FONT></TD>
\r
223 <A NAME="TokenToWords(com.sun.speech.freetts.cart.CART, com.sun.speech.freetts.en.us.PronounceableFSM, com.sun.speech.freetts.en.us.PronounceableFSM)"><!-- --></A><H3>
\r
226 public <B>TokenToWords</B>(<A HREF="../../../../../../com/sun/speech/freetts/cart/CART.html" title="interface in com.sun.speech.freetts.cart">CART</A> usNumbersCART,
227 <A HREF="../../../../../../com/sun/speech/freetts/en/us/PronounceableFSM.html" title="class in com.sun.speech.freetts.en.us">PronounceableFSM</A> prefixFSM,
228 <A HREF="../../../../../../com/sun/speech/freetts/en/us/PronounceableFSM.html" title="class in com.sun.speech.freetts.en.us">PronounceableFSM</A> suffixFSM)</PRE>
\r
230 <DD>Constructs a default USTokenWordProcessor. It uses the USEnglish
231 regular expression set (USEngRegExp) by default.
\r
233 <DT><B>Parameters:</B><DD><CODE>usNumbersCART</CODE> - the cart to use to classify numbers</DL>
\r
235 <!-- ============ METHOD DETAIL ========== -->
\r
237 <A NAME="method_detail"><!-- --></A>
238 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
239 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
240 <TD COLSPAN=1><FONT SIZE="+2">
\r
241 <B>Method Detail</B></FONT></TD>
\r
245 <A NAME="getTokenItem()"><!-- --></A><H3>
\r
248 public <A HREF="../../../../../../com/sun/speech/freetts/Item.html" title="class in com.sun.speech.freetts">Item</A> <B>getTokenItem</B>()</PRE>
\r
250 <DD>Returns the currently processing token Item.
\r
257 <DT><B>Returns:</B><DD>the current token Item; null if no item</DL>
\r
262 <A NAME="processUtterance(com.sun.speech.freetts.Utterance)"><!-- --></A><H3>
\r
263 processUtterance</H3>
\r
265 public void <B>processUtterance</B>(<A HREF="../../../../../../com/sun/speech/freetts/Utterance.html" title="class in com.sun.speech.freetts">Utterance</A> utterance)
266 throws <A HREF="../../../../../../com/sun/speech/freetts/ProcessException.html" title="class in com.sun.speech.freetts">ProcessException</A></PRE>
\r
268 <DD>process the utterance
\r
271 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../com/sun/speech/freetts/UtteranceProcessor.html#processUtterance(com.sun.speech.freetts.Utterance)">processUtterance</A></CODE> in interface <CODE><A HREF="../../../../../../com/sun/speech/freetts/UtteranceProcessor.html" title="interface in com.sun.speech.freetts">UtteranceProcessor</A></CODE></DL>
\r
274 <DT><B>Parameters:</B><DD><CODE>utterance</CODE> - the utterance contain the tokens
276 <DD><CODE><A HREF="../../../../../../com/sun/speech/freetts/ProcessException.html" title="class in com.sun.speech.freetts">ProcessException</A></CODE> - if an IOException is thrown during the
277 processing of the utterance</DL>
\r
282 <A NAME="kingLike(com.sun.speech.freetts.Item)"><!-- --></A><H3>
\r
285 public static boolean <B>kingLike</B>(<A HREF="../../../../../../com/sun/speech/freetts/Item.html" title="class in com.sun.speech.freetts">Item</A> tokenItem)</PRE>
\r
287 <DD>Returns true if the given token item contains a token that is
288 in a king-like context, e.g., "King" or "Louis".
\r
294 <DT><B>Parameters:</B><DD><CODE>tokenItem</CODE> - the token item to check
295 <DT><B>Returns:</B><DD>true or false</DL>
\r
300 <A NAME="sectionLike(com.sun.speech.freetts.Item)"><!-- --></A><H3>
\r
303 public static boolean <B>sectionLike</B>(<A HREF="../../../../../../com/sun/speech/freetts/Item.html" title="class in com.sun.speech.freetts">Item</A> tokenItem)</PRE>
\r
305 <DD>Returns true if the given token item contains a token that is
306 in a section-like context, e.g., "chapter" or "act".
\r
312 <DT><B>Parameters:</B><DD><CODE>tokenItem</CODE> - the token item to check
313 <DT><B>Returns:</B><DD>true or false</DL>
\r
318 <A NAME="isPronounceable(java.lang.String)"><!-- --></A><H3>
\r
319 isPronounceable</H3>
\r
321 public boolean <B>isPronounceable</B>(java.lang.String word)</PRE>
\r
323 <DD>Returns true if the given word is pronounceable.
324 This method is originally called us_aswd() in Flite 1.1.
\r
330 <DT><B>Parameters:</B><DD><CODE>word</CODE> - the word to test
331 <DT><B>Returns:</B><DD>true if the word is pronounceable, false otherwise</DL>
\r
336 <A NAME="toString()"><!-- --></A><H3>
\r
339 public java.lang.String <B>toString</B>()</PRE>
\r
341 <DD>Converts this object to its String representation
\r
348 <DT><B>Returns:</B><DD>the string representation of this object</DL>
\r
351 <!-- ========= END OF CLASS DATA ========= -->
\r
355 <!-- ======= START OF BOTTOM NAVBAR ====== -->
\r
356 <A NAME="navbar_bottom"><!-- --></A>
357 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
358 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
\r
360 <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
\r
361 <A NAME="navbar_bottom_firstrow"><!-- --></A>
362 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
\r
363 <TR ALIGN="center" VALIGN="top">
\r
364 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
\r
365 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
\r
366 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
\r
367 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
\r
368 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
\r
369 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
\r
370 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
\r
374 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
\r
380 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
\r
381 <A HREF="../../../../../../com/sun/speech/freetts/en/us/SuffixFSM.html" title="class in com.sun.speech.freetts.en.us"><B>PREV CLASS</B></A>
\r
382 <A HREF="../../../../../../com/sun/speech/freetts/en/us/USEnglish.html" title="class in com.sun.speech.freetts.en.us"><B>NEXT CLASS</B></A></FONT></TD>
\r
383 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
\r
384 <A HREF="../../../../../../index.html" target="_top"><B>FRAMES</B></A>
\r
385 <A HREF="TokenToWords.html" target="_top"><B>NO FRAMES</B></A>
\r
386 <SCRIPT type="text/javascript">
\r
389 document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
\r
394 <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
\r
400 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
\r
401 SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
\r
402 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
\r
403 DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
\r
406 <A NAME="skip-navbar_bottom"></A>
407 <!-- ======== END OF BOTTOM NAVBAR ======= -->
\r