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 NumberExpander (FreeTTS 1.2)
\r
10 <META NAME="keywords" CONTENT="com.sun.speech.freetts.en.us.NumberExpander 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="NumberExpander (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/FeatureProcessors.WordPunc.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/PrefixFSM.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="NumberExpander.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 | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
\r
73 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
\r
74 DETAIL: FIELD | CONSTR | <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 NumberExpander</H2>
\r
89 <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by"><B>com.sun.speech.freetts.en.us.NumberExpander</B>
\r
93 <DT>public class <B>NumberExpander</B><DT>extends java.lang.Object</DL>
\r
96 Expands Strings containing digits characters into
97 a list of words representing those digits.
99 It translates the following code from flite:
100 <code>lang/usEnglish/us_expand.c</code>
\r
107 <!-- ======== NESTED CLASS SUMMARY ======== -->
\r
110 <!-- =========== FIELD SUMMARY =========== -->
\r
113 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
\r
116 <!-- ========== METHOD SUMMARY =========== -->
\r
118 <A NAME="method_summary"><!-- --></A>
119 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
120 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
121 <TD COLSPAN=2><FONT SIZE="+2">
\r
122 <B>Method Summary</B></FONT></TD>
\r
124 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
125 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
126 <CODE>static void</CODE></FONT></TD>
\r
127 <TD><CODE><B><A HREF="../../../../../../com/sun/speech/freetts/en/us/NumberExpander.html#expandDigits(java.lang.String, com.sun.speech.freetts.en.us.WordRelation)">expandDigits</A></B>(java.lang.String numberString,
128 <A HREF="../../../../../../com/sun/speech/freetts/en/us/WordRelation.html" title="class in com.sun.speech.freetts.en.us">WordRelation</A> wordRelation)</CODE>
\r
131 Expands given token to list of words pronouncing it as digits</TD>
\r
133 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
134 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
135 <CODE>static void</CODE></FONT></TD>
\r
136 <TD><CODE><B><A HREF="../../../../../../com/sun/speech/freetts/en/us/NumberExpander.html#expandID(java.lang.String, com.sun.speech.freetts.en.us.WordRelation)">expandID</A></B>(java.lang.String numberString,
137 <A HREF="../../../../../../com/sun/speech/freetts/en/us/WordRelation.html" title="class in com.sun.speech.freetts.en.us">WordRelation</A> wordRelation)</CODE>
\r
140 Expands the given number string as pairs as in years or IDs</TD>
\r
142 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
143 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
144 <CODE>static void</CODE></FONT></TD>
\r
145 <TD><CODE><B><A HREF="../../../../../../com/sun/speech/freetts/en/us/NumberExpander.html#expandLetters(java.lang.String, com.sun.speech.freetts.en.us.WordRelation)">expandLetters</A></B>(java.lang.String letters,
146 <A HREF="../../../../../../com/sun/speech/freetts/en/us/WordRelation.html" title="class in com.sun.speech.freetts.en.us">WordRelation</A> wordRelation)</CODE>
\r
149 Expands the given string of letters as a list of single char symbols.</TD>
\r
151 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
152 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
153 <CODE>static void</CODE></FONT></TD>
\r
154 <TD><CODE><B><A HREF="../../../../../../com/sun/speech/freetts/en/us/NumberExpander.html#expandNumber(java.lang.String, com.sun.speech.freetts.en.us.WordRelation)">expandNumber</A></B>(java.lang.String numberString,
155 <A HREF="../../../../../../com/sun/speech/freetts/en/us/WordRelation.html" title="class in com.sun.speech.freetts.en.us">WordRelation</A> wordRelation)</CODE>
\r
158 Expands a digit string into a list of English words of those digits.
161 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
162 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
163 <CODE>static void</CODE></FONT></TD>
\r
164 <TD><CODE><B><A HREF="../../../../../../com/sun/speech/freetts/en/us/NumberExpander.html#expandOrdinal(java.lang.String, com.sun.speech.freetts.en.us.WordRelation)">expandOrdinal</A></B>(java.lang.String rawNumberString,
165 <A HREF="../../../../../../com/sun/speech/freetts/en/us/WordRelation.html" title="class in com.sun.speech.freetts.en.us">WordRelation</A> wordRelation)</CODE>
\r
168 Expands the digit string of an ordinal number.</TD>
\r
170 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
171 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
172 <CODE>static void</CODE></FONT></TD>
\r
173 <TD><CODE><B><A HREF="../../../../../../com/sun/speech/freetts/en/us/NumberExpander.html#expandReal(java.lang.String, com.sun.speech.freetts.en.us.WordRelation)">expandReal</A></B>(java.lang.String numberString,
174 <A HREF="../../../../../../com/sun/speech/freetts/en/us/WordRelation.html" title="class in com.sun.speech.freetts.en.us">WordRelation</A> wordRelation)</CODE>
\r
177 Expands the given number string as a real number.</TD>
\r
179 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
180 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
181 <CODE>static int</CODE></FONT></TD>
\r
182 <TD><CODE><B><A HREF="../../../../../../com/sun/speech/freetts/en/us/NumberExpander.html#expandRoman(java.lang.String)">expandRoman</A></B>(java.lang.String roman)</CODE>
\r
185 Returns the integer value of the given string of Roman numerals.</TD>
\r
187 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
188 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
189 <CODE>static boolean</CODE></FONT></TD>
\r
190 <TD><CODE><B><A HREF="../../../../../../com/sun/speech/freetts/en/us/NumberExpander.html#isDigit(char)">isDigit</A></B>(char ch)</CODE>
\r
193 Returns true if the given character is a digit (0-9 only).</TD>
\r
196 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
197 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
198 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
\r
199 <TD><B>Methods inherited from class java.lang.Object</B></TD>
\r
201 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
202 <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
\r
208 <!-- ============ FIELD DETAIL =========== -->
\r
211 <!-- ========= CONSTRUCTOR DETAIL ======== -->
\r
214 <!-- ============ METHOD DETAIL ========== -->
\r
216 <A NAME="method_detail"><!-- --></A>
217 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
218 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
219 <TD COLSPAN=1><FONT SIZE="+2">
\r
220 <B>Method Detail</B></FONT></TD>
\r
224 <A NAME="expandNumber(java.lang.String, com.sun.speech.freetts.en.us.WordRelation)"><!-- --></A><H3>
\r
227 public static void <B>expandNumber</B>(java.lang.String numberString,
228 <A HREF="../../../../../../com/sun/speech/freetts/en/us/WordRelation.html" title="class in com.sun.speech.freetts.en.us">WordRelation</A> wordRelation)</PRE>
\r
230 <DD>Expands a digit string into a list of English words of those digits.
231 For example, "1234" expands to "one two three four"
\r
234 <DT><B>Parameters:</B><DD><CODE>numberString</CODE> - the digit string to expand.<DD><CODE>wordRelation</CODE> - words are added to this Relation</DL>
\r
239 <A NAME="expandDigits(java.lang.String, com.sun.speech.freetts.en.us.WordRelation)"><!-- --></A><H3>
\r
242 public static void <B>expandDigits</B>(java.lang.String numberString,
243 <A HREF="../../../../../../com/sun/speech/freetts/en/us/WordRelation.html" title="class in com.sun.speech.freetts.en.us">WordRelation</A> wordRelation)</PRE>
\r
245 <DD>Expands given token to list of words pronouncing it as digits
\r
248 <DT><B>Parameters:</B><DD><CODE>numberString</CODE> - the string which is the number to expand<DD><CODE>wordRelation</CODE> - words are added to this Relation</DL>
\r
253 <A NAME="expandOrdinal(java.lang.String, com.sun.speech.freetts.en.us.WordRelation)"><!-- --></A><H3>
\r
256 public static void <B>expandOrdinal</B>(java.lang.String rawNumberString,
257 <A HREF="../../../../../../com/sun/speech/freetts/en/us/WordRelation.html" title="class in com.sun.speech.freetts.en.us">WordRelation</A> wordRelation)</PRE>
\r
259 <DD>Expands the digit string of an ordinal number.
\r
262 <DT><B>Parameters:</B><DD><CODE>rawNumberString</CODE> - the string which is the number to expand<DD><CODE>wordRelation</CODE> - words are added to this Relation</DL>
\r
267 <A NAME="expandID(java.lang.String, com.sun.speech.freetts.en.us.WordRelation)"><!-- --></A><H3>
\r
270 public static void <B>expandID</B>(java.lang.String numberString,
271 <A HREF="../../../../../../com/sun/speech/freetts/en/us/WordRelation.html" title="class in com.sun.speech.freetts.en.us">WordRelation</A> wordRelation)</PRE>
\r
273 <DD>Expands the given number string as pairs as in years or IDs
\r
276 <DT><B>Parameters:</B><DD><CODE>numberString</CODE> - the string which is the number to expand<DD><CODE>wordRelation</CODE> - words are added to this Relation</DL>
\r
281 <A NAME="expandReal(java.lang.String, com.sun.speech.freetts.en.us.WordRelation)"><!-- --></A><H3>
\r
284 public static void <B>expandReal</B>(java.lang.String numberString,
285 <A HREF="../../../../../../com/sun/speech/freetts/en/us/WordRelation.html" title="class in com.sun.speech.freetts.en.us">WordRelation</A> wordRelation)</PRE>
\r
287 <DD>Expands the given number string as a real number.
\r
290 <DT><B>Parameters:</B><DD><CODE>numberString</CODE> - the string which is the real number to expand<DD><CODE>wordRelation</CODE> - words are added to this Relation</DL>
\r
295 <A NAME="expandLetters(java.lang.String, com.sun.speech.freetts.en.us.WordRelation)"><!-- --></A><H3>
\r
298 public static void <B>expandLetters</B>(java.lang.String letters,
299 <A HREF="../../../../../../com/sun/speech/freetts/en/us/WordRelation.html" title="class in com.sun.speech.freetts.en.us">WordRelation</A> wordRelation)</PRE>
\r
301 <DD>Expands the given string of letters as a list of single char symbols.
\r
304 <DT><B>Parameters:</B><DD><CODE>letters</CODE> - the string of letters to expand<DD><CODE>wordRelation</CODE> - words are added to this Relation</DL>
\r
309 <A NAME="expandRoman(java.lang.String)"><!-- --></A><H3>
\r
312 public static int <B>expandRoman</B>(java.lang.String roman)</PRE>
\r
314 <DD>Returns the integer value of the given string of Roman numerals.
\r
317 <DT><B>Parameters:</B><DD><CODE>roman</CODE> - the string of Roman numbers
318 <DT><B>Returns:</B><DD>the integer value</DL>
\r
323 <A NAME="isDigit(char)"><!-- --></A><H3>
\r
326 public static boolean <B>isDigit</B>(char ch)</PRE>
\r
328 <DD>Returns true if the given character is a digit (0-9 only).
\r
331 <DT><B>Parameters:</B><DD><CODE>ch</CODE> - the character to test
332 <DT><B>Returns:</B><DD>true or false</DL>
\r
335 <!-- ========= END OF CLASS DATA ========= -->
\r
339 <!-- ======= START OF BOTTOM NAVBAR ====== -->
\r
340 <A NAME="navbar_bottom"><!-- --></A>
341 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
342 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
\r
344 <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
\r
345 <A NAME="navbar_bottom_firstrow"><!-- --></A>
346 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
\r
347 <TR ALIGN="center" VALIGN="top">
\r
348 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
\r
349 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
\r
350 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
\r
351 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
\r
352 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
\r
353 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
\r
354 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
\r
358 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
\r
364 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
\r
365 <A HREF="../../../../../../com/sun/speech/freetts/en/us/FeatureProcessors.WordPunc.html" title="class in com.sun.speech.freetts.en.us"><B>PREV CLASS</B></A>
\r
366 <A HREF="../../../../../../com/sun/speech/freetts/en/us/PrefixFSM.html" title="class in com.sun.speech.freetts.en.us"><B>NEXT CLASS</B></A></FONT></TD>
\r
367 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
\r
368 <A HREF="../../../../../../index.html" target="_top"><B>FRAMES</B></A>
\r
369 <A HREF="NumberExpander.html" target="_top"><B>NO FRAMES</B></A>
\r
370 <SCRIPT type="text/javascript">
\r
373 document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
\r
378 <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
\r
384 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
\r
385 SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
\r
386 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
\r
387 DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
\r
390 <A NAME="skip-navbar_bottom"></A>
391 <!-- ======== END OF BOTTOM NAVBAR ======= -->
\r