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 LexiconImpl (FreeTTS 1.2)
\r
10 <META NAME="keywords" CONTENT="com.sun.speech.freetts.lexicon.LexiconImpl 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="LexiconImpl (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/lexicon/LetterToSoundImpl.html" title="class in com.sun.speech.freetts.lexicon"><B>PREV CLASS</B></A>
\r
53 NEXT CLASS</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="LexiconImpl.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 | <A HREF="#field_summary">FIELD</A> | <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: <A HREF="#field_detail">FIELD</A> | <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.lexicon</FONT>
\r
86 Class LexiconImpl</H2>
\r
89 <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by"><B>com.sun.speech.freetts.lexicon.LexiconImpl</B>
\r
92 <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../../com/sun/speech/freetts/lexicon/Lexicon.html" title="interface in com.sun.speech.freetts.lexicon">Lexicon</A></DD>
\r
95 <DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../../com/sun/speech/freetts/en/us/CMULexicon.html" title="class in com.sun.speech.freetts.en.us">CMULexicon</A></DD>
\r
99 <DT>public abstract class <B>LexiconImpl</B><DT>extends java.lang.Object<DT>implements <A HREF="../../../../../com/sun/speech/freetts/lexicon/Lexicon.html" title="interface in com.sun.speech.freetts.lexicon">Lexicon</A></DL>
\r
102 Provides an implementation of a Lexicon.
104 <p>This implementation will either read from a straight ASCII file
105 or a binary file. When reading from an ASCII file, you can specify
106 when the input line is tokenized: load, lookup, or never. If you
107 specify 'load', the entire file will be parsed when it is loaded.
108 If you specify 'lookup', the file will be loaded, but the parsing
109 for each line will be delayed until it is referenced and the parsed
110 form will be saved away. If you specify 'never', the lines will
111 parsed each time they are referenced. The default is 'never'. To
112 specify the load type, set the system property as follows:
115 -Dcom.sun.speech.freetts.lexicon.LexTokenize=load
118 <p>If a binary file is used, you can also specify whether the new
119 IO package is used. The new IO package is new for JDK1.4, and can
120 greatly improve the speed of loading files. To enable new IO, use
121 the following system property (it is enabled by default):
124 -Dcom.sun.speech.freetts.useNewIO=true
127 <p>The implementation also allows users to define their own addenda
128 that will be used in addition to the system addenda. If the user
129 defines their own addenda, it values will be added to the system
130 addenda, overriding any existing elements in the system addenda.
131 To define a user addenda, the user needs to set the following
135 -Dcom.sun.speeech.freetts.lexicon.userAddenda=<URLToUserAddenda>
138 Where <URLToUserAddenda> is a URL pointing to an ASCII file
139 containing addenda entries.
141 <p>[[[TODO: support multiple homographs with the same part of speech.]]]
\r
148 <!-- ======== NESTED CLASS SUMMARY ======== -->
\r
151 <!-- =========== FIELD SUMMARY =========== -->
\r
153 <A NAME="field_summary"><!-- --></A>
154 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
155 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
156 <TD COLSPAN=2><FONT SIZE="+2">
\r
157 <B>Field Summary</B></FONT></TD>
\r
159 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
160 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
161 <CODE>protected boolean</CODE></FONT></TD>
\r
162 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/lexicon/LexiconImpl.html#tokenizeOnLoad">tokenizeOnLoad</A></B></CODE>
\r
165 If true, the phone string is replaced with the phone array in
166 the hashmap when the phone array is loaded. </TD>
\r
168 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
169 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
170 <CODE>protected boolean</CODE></FONT></TD>
\r
171 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/lexicon/LexiconImpl.html#tokenizeOnLookup">tokenizeOnLookup</A></B></CODE>
\r
174 If true, the phone string is replaced with the phone array in
175 the hashmap when the phone array is first looked up. </TD>
\r
179 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
\r
181 <A NAME="constructor_summary"><!-- --></A>
182 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
183 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
184 <TD COLSPAN=2><FONT SIZE="+2">
\r
185 <B>Constructor Summary</B></FONT></TD>
\r
187 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
188 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/lexicon/LexiconImpl.html#LexiconImpl()">LexiconImpl</A></B>()</CODE>
\r
191 Class constructor for an empty Lexicon.</TD>
\r
193 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
194 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/lexicon/LexiconImpl.html#LexiconImpl(java.net.URL, java.net.URL, java.net.URL, boolean)">LexiconImpl</A></B>(java.net.URL compiledURL,
195 java.net.URL addendaURL,
196 java.net.URL letterToSoundURL,
197 boolean binary)</CODE>
\r
200 Create a new LexiconImpl by reading from the given URLS.</TD>
\r
204 <!-- ========== METHOD SUMMARY =========== -->
\r
206 <A NAME="method_summary"><!-- --></A>
207 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
208 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
209 <TD COLSPAN=2><FONT SIZE="+2">
\r
210 <B>Method Summary</B></FONT></TD>
\r
212 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
213 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
214 <CODE> void</CODE></FONT></TD>
\r
215 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/lexicon/LexiconImpl.html#addAddendum(java.lang.String, java.lang.String, java.lang.String[])">addAddendum</A></B>(java.lang.String word,
216 java.lang.String partOfSpeech,
217 java.lang.String[] phones)</CODE>
\r
220 Adds a word to the addenda.</TD>
\r
222 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
223 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
224 <CODE> boolean</CODE></FONT></TD>
\r
225 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/lexicon/LexiconImpl.html#compare(com.sun.speech.freetts.lexicon.LexiconImpl)">compare</A></B>(<A HREF="../../../../../com/sun/speech/freetts/lexicon/LexiconImpl.html" title="class in com.sun.speech.freetts.lexicon">LexiconImpl</A> other)</CODE>
\r
228 Tests to see if this lexicon is identical to the other for
229 debugging purposes.</TD>
\r
231 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
232 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
233 <CODE>protected java.util.Map</CODE></FONT></TD>
\r
234 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/lexicon/LexiconImpl.html#createLexicon(java.io.InputStream, boolean, int)">createLexicon</A></B>(java.io.InputStream is,
236 int estimatedSize)</CODE>
\r
239 Reads the given input stream as lexicon data and returns the
240 results in a <code>Map</code>.</TD>
\r
242 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
243 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
244 <CODE> void</CODE></FONT></TD>
\r
245 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/lexicon/LexiconImpl.html#dumpBinary(java.lang.String)">dumpBinary</A></B>(java.lang.String path)</CODE>
\r
248 Dumps this lexicon (just the compiled form). </TD>
\r
250 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
251 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
252 <CODE>protected static java.lang.String</CODE></FONT></TD>
\r
253 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/lexicon/LexiconImpl.html#fixPartOfSpeech(java.lang.String)">fixPartOfSpeech</A></B>(java.lang.String partOfSpeech)</CODE>
\r
256 Fixes the part of speech if it is <code>null</code>. </TD>
\r
258 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
259 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
260 <CODE>protected java.lang.String[]</CODE></FONT></TD>
\r
261 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/lexicon/LexiconImpl.html#getPhones(java.util.Map, java.lang.String)">getPhones</A></B>(java.util.Map lexicon,
262 java.lang.String wordAndPartOfSpeech)</CODE>
\r
265 Gets a phone list for a word from a given lexicon. </TD>
\r
267 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
268 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
269 <CODE>protected java.lang.String[]</CODE></FONT></TD>
\r
270 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/lexicon/LexiconImpl.html#getPhones(java.util.Map, java.lang.String, java.lang.String)">getPhones</A></B>(java.util.Map lexicon,
271 java.lang.String word,
272 java.lang.String partOfSpeech)</CODE>
\r
275 Gets a phone list for a word from a given lexicon. </TD>
\r
277 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
278 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
279 <CODE>protected java.lang.String[]</CODE></FONT></TD>
\r
280 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/lexicon/LexiconImpl.html#getPhones(java.lang.String)">getPhones</A></B>(java.lang.String phones)</CODE>
\r
283 Turns the phone <code>String</code> into a <code>String[]</code>,
284 using " " as the delimiter.</TD>
\r
286 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
287 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
288 <CODE> java.lang.String[]</CODE></FONT></TD>
\r
289 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/lexicon/LexiconImpl.html#getPhones(java.lang.String, java.lang.String)">getPhones</A></B>(java.lang.String word,
290 java.lang.String partOfSpeech)</CODE>
\r
293 Gets the phone list for a given word. </TD>
\r
295 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
296 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
297 <CODE> java.lang.String[]</CODE></FONT></TD>
\r
298 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/lexicon/LexiconImpl.html#getPhones(java.lang.String, java.lang.String, boolean)">getPhones</A></B>(java.lang.String word,
299 java.lang.String partOfSpeech,
300 boolean useLTS)</CODE>
\r
303 Gets the phone list for a given word. </TD>
\r
305 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
306 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
307 <CODE> boolean</CODE></FONT></TD>
\r
308 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/lexicon/LexiconImpl.html#isLoaded()">isLoaded</A></B>()</CODE>
\r
311 Determines if this lexicon is loaded.</TD>
\r
313 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
314 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
315 <CODE> void</CODE></FONT></TD>
\r
316 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/lexicon/LexiconImpl.html#load()">load</A></B>()</CODE>
\r
319 Loads the data for this lexicon. </TD>
\r
321 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
322 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
323 <CODE>protected java.util.Map</CODE></FONT></TD>
\r
324 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/lexicon/LexiconImpl.html#loadTextLexicon(java.io.InputStream, int)">loadTextLexicon</A></B>(java.io.InputStream is,
325 int estimatedSize)</CODE>
\r
328 Reads the given input stream as text lexicon data and returns the
329 results in a <code>Map</code>.</TD>
\r
331 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
332 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
333 <CODE>protected void</CODE></FONT></TD>
\r
334 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/lexicon/LexiconImpl.html#parseAndAdd(java.util.Map, java.lang.String)">parseAndAdd</A></B>(java.util.Map lexicon,
335 java.lang.String line)</CODE>
\r
338 Creates a word from the given input line and add it to the lexicon.</TD>
\r
340 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
341 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
342 <CODE> void</CODE></FONT></TD>
\r
343 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/lexicon/LexiconImpl.html#removeAddendum(java.lang.String, java.lang.String)">removeAddendum</A></B>(java.lang.String word,
344 java.lang.String partOfSpeech)</CODE>
\r
347 Removes a word from the addenda.</TD>
\r
349 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
350 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
351 <CODE>protected void</CODE></FONT></TD>
\r
352 <TD><CODE><B><A HREF="../../../../../com/sun/speech/freetts/lexicon/LexiconImpl.html#setLexiconParameters(java.net.URL, java.net.URL, java.net.URL, boolean)">setLexiconParameters</A></B>(java.net.URL compiledURL,
353 java.net.URL addendaURL,
354 java.net.URL letterToSoundURL,
355 boolean binary)</CODE>
\r
358 Sets the lexicon parameters</TD>
\r
361 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
362 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
363 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
\r
364 <TD><B>Methods inherited from class java.lang.Object</B></TD>
\r
366 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
367 <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
\r
370 <A NAME="methods_inherited_from_class_com.sun.speech.freetts.lexicon.Lexicon"><!-- --></A>
371 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
372 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
\r
373 <TD><B>Methods inherited from interface com.sun.speech.freetts.lexicon.<A HREF="../../../../../com/sun/speech/freetts/lexicon/Lexicon.html" title="interface in com.sun.speech.freetts.lexicon">Lexicon</A></B></TD>
\r
375 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
376 <TD><CODE><A HREF="../../../../../com/sun/speech/freetts/lexicon/Lexicon.html#isSyllableBoundary(java.util.List, java.lang.String[], int)">isSyllableBoundary</A></CODE></TD>
\r
382 <!-- ============ FIELD DETAIL =========== -->
\r
384 <A NAME="field_detail"><!-- --></A>
385 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
386 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
387 <TD COLSPAN=1><FONT SIZE="+2">
\r
388 <B>Field Detail</B></FONT></TD>
\r
392 <A NAME="tokenizeOnLoad"><!-- --></A><H3>
\r
393 tokenizeOnLoad</H3>
\r
395 protected boolean <B>tokenizeOnLoad</B></PRE>
\r
397 <DD>If true, the phone string is replaced with the phone array in
398 the hashmap when the phone array is loaded. The side effects
399 of this are quicker lookups, but more memory usage and a longer
407 <A NAME="tokenizeOnLookup"><!-- --></A><H3>
\r
408 tokenizeOnLookup</H3>
\r
410 protected boolean <B>tokenizeOnLookup</B></PRE>
\r
412 <DD>If true, the phone string is replaced with the phone array in
413 the hashmap when the phone array is first looked up. The side effects
414 Set by cmufilelex.tokenize=lookup.
\r
420 <!-- ========= CONSTRUCTOR DETAIL ======== -->
\r
422 <A NAME="constructor_detail"><!-- --></A>
423 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
424 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
425 <TD COLSPAN=1><FONT SIZE="+2">
\r
426 <B>Constructor Detail</B></FONT></TD>
\r
430 <A NAME="LexiconImpl(java.net.URL, java.net.URL, java.net.URL, boolean)"><!-- --></A><H3>
\r
433 public <B>LexiconImpl</B>(java.net.URL compiledURL,
434 java.net.URL addendaURL,
435 java.net.URL letterToSoundURL,
436 boolean binary)</PRE>
\r
438 <DD>Create a new LexiconImpl by reading from the given URLS.
\r
440 <DT><B>Parameters:</B><DD><CODE>compiledURL</CODE> - a URL pointing to the compiled lexicon<DD><CODE>addendaURL</CODE> - a URL pointing to lexicon addenda<DD><CODE>letterToSoundURL</CODE> - a LetterToSound to use if a word cannot
441 be found in the compiled form or the addenda<DD><CODE>binary</CODE> - if <code>true</code>, the input streams are binary;
442 otherwise, they are text.</DL>
\r
445 <A NAME="LexiconImpl()"><!-- --></A><H3>
\r
448 public <B>LexiconImpl</B>()</PRE>
\r
450 <DD>Class constructor for an empty Lexicon.
\r
454 <!-- ============ METHOD DETAIL ========== -->
\r
456 <A NAME="method_detail"><!-- --></A>
457 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
458 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
459 <TD COLSPAN=1><FONT SIZE="+2">
\r
460 <B>Method Detail</B></FONT></TD>
\r
464 <A NAME="setLexiconParameters(java.net.URL, java.net.URL, java.net.URL, boolean)"><!-- --></A><H3>
\r
465 setLexiconParameters</H3>
\r
467 protected void <B>setLexiconParameters</B>(java.net.URL compiledURL,
468 java.net.URL addendaURL,
469 java.net.URL letterToSoundURL,
470 boolean binary)</PRE>
\r
472 <DD>Sets the lexicon parameters
\r
478 <DT><B>Parameters:</B><DD><CODE>compiledURL</CODE> - a URL pointing to the compiled lexicon<DD><CODE>addendaURL</CODE> - a URL pointing to lexicon addenda<DD><CODE>letterToSoundURL</CODE> - a URL pointing to the LetterToSound to use<DD><CODE>binary</CODE> - if <code>true</code>, the input streams are binary;
479 otherwise, they are text.</DL>
\r
484 <A NAME="isLoaded()"><!-- --></A><H3>
\r
487 public boolean <B>isLoaded</B>()</PRE>
\r
489 <DD>Determines if this lexicon is loaded.
\r
492 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/lexicon/Lexicon.html#isLoaded()">isLoaded</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/lexicon/Lexicon.html" title="interface in com.sun.speech.freetts.lexicon">Lexicon</A></CODE></DL>
\r
496 <DT><B>Returns:</B><DD><code>true</code> if the lexicon is loaded</DL>
\r
501 <A NAME="load()"><!-- --></A><H3>
\r
504 public void <B>load</B>()
505 throws java.io.IOException</PRE>
\r
507 <DD>Loads the data for this lexicon. If the
\r
510 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/lexicon/Lexicon.html#load()">load</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/lexicon/Lexicon.html" title="interface in com.sun.speech.freetts.lexicon">Lexicon</A></CODE></DL>
\r
515 <DD><CODE>java.io.IOException</CODE> - if errors occur during loading</DL>
\r
520 <A NAME="createLexicon(java.io.InputStream, boolean, int)"><!-- --></A><H3>
\r
523 protected java.util.Map <B>createLexicon</B>(java.io.InputStream is,
525 int estimatedSize)
526 throws java.io.IOException</PRE>
\r
528 <DD>Reads the given input stream as lexicon data and returns the
529 results in a <code>Map</code>.
\r
535 <DT><B>Parameters:</B><DD><CODE>is</CODE> - the input stream<DD><CODE>binary</CODE> - if <code>true</code>, the data is binary<DD><CODE>estimatedSize</CODE> - the estimated size of the lexicon
537 <DD><CODE>java.io.IOException</CODE> - if errors are encountered while reading the data</DL>
\r
542 <A NAME="loadTextLexicon(java.io.InputStream, int)"><!-- --></A><H3>
\r
543 loadTextLexicon</H3>
\r
545 protected java.util.Map <B>loadTextLexicon</B>(java.io.InputStream is,
546 int estimatedSize)
547 throws java.io.IOException</PRE>
\r
549 <DD>Reads the given input stream as text lexicon data and returns the
550 results in a <code>Map</code>.
\r
556 <DT><B>Parameters:</B><DD><CODE>is</CODE> - the input stream<DD><CODE>estimatedSize</CODE> - the estimated number of entries of the lexicon
558 <DD><CODE>java.io.IOException</CODE> - if errors are encountered while reading the data</DL>
\r
563 <A NAME="parseAndAdd(java.util.Map, java.lang.String)"><!-- --></A><H3>
\r
566 protected void <B>parseAndAdd</B>(java.util.Map lexicon,
567 java.lang.String line)</PRE>
\r
569 <DD>Creates a word from the given input line and add it to the lexicon.
\r
575 <DT><B>Parameters:</B><DD><CODE>lexicon</CODE> - the lexicon<DD><CODE>line</CODE> - the input text</DL>
\r
580 <A NAME="getPhones(java.lang.String, java.lang.String)"><!-- --></A><H3>
\r
583 public java.lang.String[] <B>getPhones</B>(java.lang.String word,
584 java.lang.String partOfSpeech)</PRE>
\r
586 <DD>Gets the phone list for a given word. If a phone list cannot
587 be found, returns <code>null</code>. The format is lexicon
588 dependent. If the part of speech does not matter, pass in
592 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/lexicon/Lexicon.html#getPhones(java.lang.String, java.lang.String)">getPhones</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/lexicon/Lexicon.html" title="interface in com.sun.speech.freetts.lexicon">Lexicon</A></CODE></DL>
\r
595 <DT><B>Parameters:</B><DD><CODE>word</CODE> - the word to find<DD><CODE>partOfSpeech</CODE> - the part of speech
596 <DT><B>Returns:</B><DD>the list of phones for word or <code>null</code></DL>
\r
601 <A NAME="getPhones(java.lang.String, java.lang.String, boolean)"><!-- --></A><H3>
\r
604 public java.lang.String[] <B>getPhones</B>(java.lang.String word,
605 java.lang.String partOfSpeech,
606 boolean useLTS)</PRE>
\r
608 <DD>Gets the phone list for a given word. If a phone list cannot
609 be found, <code>null</code> is returned. The
610 <code>partOfSpeech</code> is implementation dependent, but
611 <code>null</code> always matches.
\r
614 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/lexicon/Lexicon.html#getPhones(java.lang.String, java.lang.String, boolean)">getPhones</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/lexicon/Lexicon.html" title="interface in com.sun.speech.freetts.lexicon">Lexicon</A></CODE></DL>
\r
617 <DT><B>Parameters:</B><DD><CODE>word</CODE> - the word to find<DD><CODE>partOfSpeech</CODE> - the part of speech or <code>null</code><DD><CODE>useLTS</CODE> - whether to use the letter-to-sound rules when
618 the word is not in the lexicon.
619 <DT><B>Returns:</B><DD>the list of phones for word or null</DL>
\r
624 <A NAME="getPhones(java.util.Map, java.lang.String, java.lang.String)"><!-- --></A><H3>
\r
627 protected java.lang.String[] <B>getPhones</B>(java.util.Map lexicon,
628 java.lang.String word,
629 java.lang.String partOfSpeech)</PRE>
\r
631 <DD>Gets a phone list for a word from a given lexicon. If a phone
632 list cannot be found, returns <code>null</code>. The format is
633 lexicon dependent. If the part of speech does not matter, pass
634 in <code>null</code>.
\r
640 <DT><B>Parameters:</B><DD><CODE>lexicon</CODE> - the lexicon<DD><CODE>word</CODE> - the word to find<DD><CODE>partOfSpeech</CODE> - the part of speech
641 <DT><B>Returns:</B><DD>the list of phones for word or <code>null</code></DL>
\r
646 <A NAME="getPhones(java.util.Map, java.lang.String)"><!-- --></A><H3>
\r
649 protected java.lang.String[] <B>getPhones</B>(java.util.Map lexicon,
650 java.lang.String wordAndPartOfSpeech)</PRE>
\r
652 <DD>Gets a phone list for a word from a given lexicon. If a phone
653 list cannot be found, returns <code>null</code>.
\r
659 <DT><B>Parameters:</B><DD><CODE>lexicon</CODE> - the lexicon<DD><CODE>wordAndPartOfSpeech</CODE> - word and part of speech concatenated
661 <DT><B>Returns:</B><DD>the list of phones for word or <code>null</code></DL>
\r
666 <A NAME="getPhones(java.lang.String)"><!-- --></A><H3>
\r
669 protected java.lang.String[] <B>getPhones</B>(java.lang.String phones)</PRE>
\r
671 <DD>Turns the phone <code>String</code> into a <code>String[]</code>,
672 using " " as the delimiter.
\r
678 <DT><B>Parameters:</B><DD><CODE>phones</CODE> - the phones
679 <DT><B>Returns:</B><DD>the phones split into an array</DL>
\r
684 <A NAME="addAddendum(java.lang.String, java.lang.String, java.lang.String[])"><!-- --></A><H3>
\r
687 public void <B>addAddendum</B>(java.lang.String word,
688 java.lang.String partOfSpeech,
689 java.lang.String[] phones)</PRE>
\r
691 <DD>Adds a word to the addenda.
\r
694 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/lexicon/Lexicon.html#addAddendum(java.lang.String, java.lang.String, java.lang.String[])">addAddendum</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/lexicon/Lexicon.html" title="interface in com.sun.speech.freetts.lexicon">Lexicon</A></CODE></DL>
\r
697 <DT><B>Parameters:</B><DD><CODE>word</CODE> - the word to find<DD><CODE>partOfSpeech</CODE> - the part of speech<DD><CODE>phones</CODE> - the phones for the word</DL>
\r
702 <A NAME="removeAddendum(java.lang.String, java.lang.String)"><!-- --></A><H3>
\r
703 removeAddendum</H3>
\r
705 public void <B>removeAddendum</B>(java.lang.String word,
706 java.lang.String partOfSpeech)</PRE>
\r
708 <DD>Removes a word from the addenda.
\r
711 <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../com/sun/speech/freetts/lexicon/Lexicon.html#removeAddendum(java.lang.String, java.lang.String)">removeAddendum</A></CODE> in interface <CODE><A HREF="../../../../../com/sun/speech/freetts/lexicon/Lexicon.html" title="interface in com.sun.speech.freetts.lexicon">Lexicon</A></CODE></DL>
\r
714 <DT><B>Parameters:</B><DD><CODE>word</CODE> - the word to remove<DD><CODE>partOfSpeech</CODE> - the part of speech</DL>
\r
719 <A NAME="dumpBinary(java.lang.String)"><!-- --></A><H3>
\r
722 public void <B>dumpBinary</B>(java.lang.String path)</PRE>
\r
724 <DD>Dumps this lexicon (just the compiled form). Lexicon will be
725 dumped to two binary files PATH_compiled.bin and
732 <DT><B>Parameters:</B><DD><CODE>path</CODE> - the root path to dump it to</DL>
\r
737 <A NAME="compare(com.sun.speech.freetts.lexicon.LexiconImpl)"><!-- --></A><H3>
\r
740 public boolean <B>compare</B>(<A HREF="../../../../../com/sun/speech/freetts/lexicon/LexiconImpl.html" title="class in com.sun.speech.freetts.lexicon">LexiconImpl</A> other)</PRE>
\r
742 <DD>Tests to see if this lexicon is identical to the other for
743 debugging purposes.
\r
749 <DT><B>Parameters:</B><DD><CODE>other</CODE> - the other lexicon to compare to
750 <DT><B>Returns:</B><DD>true if lexicons are identical</DL>
\r
755 <A NAME="fixPartOfSpeech(java.lang.String)"><!-- --></A><H3>
\r
756 fixPartOfSpeech</H3>
\r
758 protected static java.lang.String <B>fixPartOfSpeech</B>(java.lang.String partOfSpeech)</PRE>
\r
760 <DD>Fixes the part of speech if it is <code>null</code>. The
761 default representation of a <code>null</code> part of speech
771 <!-- ========= END OF CLASS DATA ========= -->
\r
775 <!-- ======= START OF BOTTOM NAVBAR ====== -->
\r
776 <A NAME="navbar_bottom"><!-- --></A>
777 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
778 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
\r
780 <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
\r
781 <A NAME="navbar_bottom_firstrow"><!-- --></A>
782 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
\r
783 <TR ALIGN="center" VALIGN="top">
\r
784 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
\r
785 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
\r
786 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
\r
787 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
\r
788 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
\r
789 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
\r
790 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
\r
794 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
\r
800 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
\r
801 <A HREF="../../../../../com/sun/speech/freetts/lexicon/LetterToSoundImpl.html" title="class in com.sun.speech.freetts.lexicon"><B>PREV CLASS</B></A>
\r
802 NEXT CLASS</FONT></TD>
\r
803 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
\r
804 <A HREF="../../../../../index.html" target="_top"><B>FRAMES</B></A>
\r
805 <A HREF="LexiconImpl.html" target="_top"><B>NO FRAMES</B></A>
\r
806 <SCRIPT type="text/javascript">
\r
809 document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
\r
814 <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
\r
820 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
\r
821 SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
\r
822 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
\r
823 DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
\r
826 <A NAME="skip-navbar_bottom"></A>
827 <!-- ======== END OF BOTTOM NAVBAR ======= -->
\r