PageRenderTime 53ms CodeModel.GetById 33ms app.highlight 12ms RepoModel.GetById 1ms app.codeStats 0ms

/native/external/espeak/docs/dictionary.html

http://eyes-free.googlecode.com/
HTML | 623 lines | 600 code | 23 blank | 0 comment | 0 complexity | fb5c977e7e54031e9b36c45b7dac3654 MD5 | raw file
  1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2<html>
  3
  4<head>
  5  <title>eSpeak: Pronunciation Dictionaries</title>
  6  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  7</head>
  8<body>
  9
 10<A href="docindex.html">Back</A>
 11<hr>
 12<h2>4. TEXT TO PHONEME TRANSLATION</h2>
 13<hr>
 14<h3>4.1 Translation Files</h3>
 15There is a separate set of pronunciation files for each language, their names starting with the language name.
 16<p>
 17There are two separate methods for translating words into phonemes:
 18<ul>
 19<li>Pronunciation Rules.  These are an attempt to define the pronunciation rules for the language. The source file is:<br>
 20	<strong><em>&lt;language&gt;_rules</em></strong>&nbsp;	(eg.  en_rules)<br>
 21
 22<p>
 23<li>
 24Lookup Dictionary.  A list of individual words and their pronunciations and/or various other properties.  The source files are:<br>
 25	<strong><em>&lt;language&gt;_list</em></strong>&nbsp;	(eg.  en_list) and optionally <strong><em>&lt;language&gt;_extra</em></strong>&nbsp;<br>
 26</ul>
 27These two files are compiled into the file
 28	<strong><em>&lt;language&gt;_dict</em></strong>&nbsp; in the espeak-data directory (eg.  espeak-data/en_dict)
 29
 30<p>&nbsp;<hr>
 31<h3>4.2  Phoneme names</h3>
 32Each of the language's phonemes is represented by a mnemonic of 1, 2, 3, or 4 characters.  Together with a number of utility codes (eg. stress marks and pauses), these are defined in the phoneme data file (see *spec not yet available*).
 33<p>
 34The utility 'phonemes' are:
 35
 36<ul><table>
 37  <tbody align="left">
 38    <tr>
 39      <td><strong>' </strong></td>
 40      <td>primary stress</td>
 41    </tr>
 42    <tr>
 43      <td><strong>, </strong></td>
 44      <td>secondary stress</td>
 45    </tr>
 46    <tr>
 47      <td><strong>% </strong></td>
 48      <td>unstressed syllable</td>
 49    </tr>
 50    <tr>
 51      <td><strong>=&nbsp;&nbsp;&nbsp;</strong></td>
 52      <td>put the primary stress on the preceding syllable</td>
 53    </tr>
 54    <tr>
 55      <td><strong>_:</strong></td>
 56      <td>short pause</td>
 57    </tr>
 58    <tr>
 59      <td><strong>_</strong></td>
 60      <td>a shorter pause</td>
 61    </tr>
 62    <tr>
 63      <td><strong>|| </strong></td>
 64      <td>indicates a word boundary within a phoneme string</td>
 65    </tr>
 66    <tr>
 67      <td><strong>| </strong></td>
 68      <td>can be used to separate two adjacent characters, to prevent them from being considered as a multi-character phoneme mnemonic</td>
 69    </tr>
 70  </tbody>
 71</table>
 72</ul>
 73
 74It is not necessary to specify the stress of every syllable.  Stress markers are only needed in order to change the effect of the language's default stress rule.
 75<p>
 76The phonemes which are used to represent a language's sounds are based on the Kirshenbaum ascii character representation of the International Phonetic Alphabet <a href="http://www.kirshenbaum.net/IPA/ascii-ipa.pdf">www.kirshenbaum.net/IPA/ascii-ipa.pdf</a>
 77
 78<p>&nbsp;<hr>
 79<h3>4.3  Pronunciation Rules</h3>
 80The rules in the <strong><em>&lt;language&gt;_rules</em></strong>&nbsp;  file specify the phonemes which are used to pronounce each letter, or sequence of letters.  Some rules only apply when the letter or letters are preceded by, or followed by, other specified letters.
 81<p>
 82To find the pronunciation of a word, the rules are searched and any which match the letters at the in the word are given a score depending on how many letters are matched.  The pronunciation from the best matching rule is chosen. The pointer into the source word is then advanced past those letters which have been matched and the process is repeated until all the letters of the word have been processed.
 83<p>
 84<h4>4.3.1 Rule Groups</h4>
 85The rules are organized in groups, each starting with a ".group" line:
 86<ul><dl>
 87<dt><strong>.group &lt;character&gt;</strong><br><dd>
 88	A group for each letter or character.
 89<p>
 90<dt><strong>.group &lt;2 characters&gt;</strong><br><dd>
 91	Optional groups for some common 2 letter combinations.  This is only needed, for efficiency, in cases where there are many rules for a particular letter.  They would not be needed for a language which has regular spelling rules.
 92<p>
 93<dt><strong>.group</strong><br><dd>
 94	A group for other characters which don't have their own group.
 95<p>
 96<dt><strong>.L&lt;nn&gt;</strong><br><dd>
 97	Defines a group of letter sequences, any of which can match with <strong>Lnn</strong> in a <strong>post</strong> rule (see below).  <strong>nn</strong> is a 2 digit decimal number in the range 01 to 20.  eg:<p>
 98	<code>.L01  b bl br pl pr</code>
 99<p>
100<dt><strong>.replace</strong><br><dd>
101	See section 4.7 Character Substitution, below.
102</dl>
103</ul>When matching a word, firstly the 2-letter group for the two letters at the current position in the word (if such a group exists) is searched, and then the single-letter group.  The highest scoring rule in either of those two groups is used.
104
105<h4>4.3.2 Rules</h4>
106Each rule is on separate line, and has the syntax:
107<ul>
108	[&lt;pre&gt;)]  &lt;match&gt;  [(&lt;post&gt;]  &lt;phoneme string&gt;
109</ul>
110eg.
111
112<ul><pre>.group o
113       o        0	// "o" is pronounced as [0]
114       oo       u:      // but "oo" is pronounced as [u:]
115    b) oo (k    U
116</pre>
117</ul> "oo" is pronounced as [u:], but when also preceded by "b" and followed by "k", it is pronounced [U].
118<p>
119In the case of a single-letter group, the first character of &lt;match&gt; much be the group letter.  In the case of a 2-letter group, the first two characters of &lt;match&gt; must be the group letters.  The second and third rules above may be in either  .group o  or  .group oo
120<p>
121Alphabetic characters in the &lt;pre&gt;, &lt;match&gt;, and &lt;post&gt; parts must be lower case, and matching is case-insensitive.  Some upper case letters are used in &lt;pre&gt; and &lt;post&gt; with special meanings.
122<p>
123<h4>4.3.3 Special characters in &lt;phoneme string&gt;:</h4>
124<ul><table>
125  <tbody>
126    <tr>
127      <td><strong>_^_&lt;language code&gt;&nbsp;&nbsp;&nbsp;</strong></td>
128      <td>Translate using a different language.</td>
129    </tr>
130  </tbody>
131</table>
132If this rule is selected when translating a word, then the translation is aborted and the word is re-translated using the specified different language.  &lt;language code&gt; may be upper or lower case. This can be used to recognise certain letter combinations as being foreign words and to use the foreign pronunciation for them. eg:
133<pre>
134    th (_     _^_EN
135</pre>
136indicates that a word which ends in "th" is translated using the English translation rules and spoken with English phonemes.
137</ul>
138<h4>4.3.4 Special Characters in both &lt;pre&gt; and &lt;post&gt;:</h4>
139
140<ul><table>
141  <tbody>
142    <tr>
143      <td><strong>_</strong></td>
144      <td>Beginning or end of a word (or a hyphen).</td>
145    </tr>
146    <tr>
147      <td><strong>-</strong></td>
148      <td>Hyphen.</td>
149    </tr>
150    <tr>
151      <td><strong>A</strong></td>
152      <td>Any vowel (the set of vowel characters may be defined for a particular language).</td>
153    </tr>
154    <tr>
155      <td><strong>C</strong></td>
156      <td>Any consonant.</td>
157    </tr>
158    <tr>
159      <td><strong>B&nbsp;H&nbsp;F&nbsp;G&nbsp;Y&nbsp;</strong></td>
160      <td>These may indicate other sets of characters (defined for a particular language).</td>
161    </tr>
162    <tr>
163      <td><strong>D</strong></td>
164      <td>Any digit.</td>
165    </tr>
166    <tr>
167      <td><strong>K</strong></td>
168      <td>Not a vowel (i.e. a consonant or word boundary or non-alphabetic character).</td>
169    </tr>
170    <tr>
171      <td><strong>X</strong></td>
172      <td>There is no vowel until the word boundary.</td>
173    </tr>
174    <tr>
175      <td><strong>Z</strong></td>
176      <td>A non-alphabetic character.</td>
177    </tr>
178    <tr>
179      <td><strong>%</strong></td>
180      <td>Doubled (placed before a character in &lt;pre&gt; and after it in &lt;post&gt;.</td>
181    </tr>
182    <tr>
183      <td><strong>/</strong></td>
184      <td>The following character is treated literally.</td>
185    </tr>
186  </tbody>
187</table>
188</ul>
189The sets of letters indicated by A, B, C, E, F G may be defined differently for each language.
190<p>
191Examples of rules:
192<pre>     _)  a         // "a" at the start of a word
193         a (CC     // "a" followed by two consonants
194         a (C%     // "a" followed by a double consonant (the same letter twice)
195         a (/%     // "a" followed by a percent sign
196     %C) a         // "a" preceded by a double consonants
197</pre>
198<h4>4.3.5 Special characters only in &lt;pre&gt;:</h4>
199<ul><table>
200  <tbody>
201    <tr>
202      <td><strong>@&nbsp;&nbsp;&nbsp;</strong></td>
203      <td>Any syllable.</td>
204    </tr>
205    <tr>
206      <td><strong>&#038;</strong></td>
207      <td>A syllable which may be stressed (i.e. is not defined as unstressed).</td>
208    </tr>
209    <tr>
210      <td><strong>V</strong></td>
211      <td>Matches only if a previous word has indicated that a verb form is expected.</td>
212    </tr>
213  </tbody>
214</table>
215</ul>
216eg.
217<pre>     @@)  bi      // "bi" preceded by at least two syllables
218     @@a) bi      // "bi" preceded by at least 2 syllables and following 'a'
219</pre>
220Note, that matching characters in the &lt;pre&gt; part do not affect the syllable counting.
221<p>
222<h4>4.3.6 Special characters only in &lt;post&gt;:</h4>
223<ul><table>
224  <tbody>
225    <tr>
226      <td><strong>@</strong></td>
227      <td>A vowel follows somewhere in the word.</td>
228    </tr>
229    <tr>
230      <td><strong>+</strong></td>
231      <td>Force an increase in the score in this rule (may be repeated for more effect).</td>
232    </tr>
233    <tr>
234      <td><strong>S&lt;number&gt;&nbsp;&nbsp;</strong></td>
235      <td>This number of matching characters are a standard suffix, remove them and retranslate the word.</td>
236    </tr>
237    <tr>
238      <td><strong>P&lt;number&gt;</strong></td>
239      <td>This number of matching characters are a standard prefix, remove them and retranslate the word.</td>
240    </tr>
241    <tr>
242      <td><strong>Lnn</strong></td>
243      <td><strong>nn</strong> is a 2-digit decimal number in the range 01 to 20<br>
244          Matches with any of the letter sequences which have been defined for letter group <strong>nn</strong></td>
245    </tr>
246    <tr>
247      <td><strong>N</strong></td>
248      <td>Only use this rule if the word is not a retranslation after removing a suffix.</td>
249    </tr>
250    <tr>
251      <td><strong>T</strong></td>
252      <td>Only use this rule if the word in found in the *_list file with the <b>$alt1</b> attribute.</td>
253    </tr>
254    <tr>
255      <td><strong>#</strong></td>
256      <td>(English specific) change the next "e" into a special character "E"</td>
257    </tr>
258  </tbody>
259</table>
260</ul>
261
262eg.
263<pre>   @) ly (_$2   lI      // "ly", at end of a word with at least one other
264                        //   syllable, is a suffix pronounced [lI].  Remove
265                        //   it and retranslate the word.
266
267   _) un (@P2   Â?Vn     // "un" at the start of a word is an unstressed
268                        //   prefix pronounced [Vn]
269   _) un (i     ju:     // ... except in words starting "uni"
270   _) un (inP2  ,Vn     // ... but it is for words starting "unin"
271</pre>
272S and P must be at the end of the &lt;post&gt; string.
273<p>
274S&lt;number&gt; may be followed by additonal letters (eg. S2ei ).  Some of these are probably specific to English, but similar functions could be used for other languages.
275
276<ul><table>
277  <tbody>
278    <tr>
279      <td><strong>q</strong></td>
280      <td>query the _list file to find stress position or other attributes for the stem, but don't re-translate the word with the suffix removed.</td>
281    </tr>
282    <tr>
283      <td><strong>t</strong></td>
284      <td>determine the stress pattern of the word <strong>before</strong> adding the suffix</td>
285    </tr>
286    <tr>
287      <td><strong>d&nbsp;&nbsp;&nbsp;</strong></td>
288      <td>the previous letter may have been doubled when the suffix was added.</td>
289    </tr>
290    <tr>
291      <td><strong>e</strong></td>
292      <td>"e" may have been removed.</td>
293    </tr>
294    <tr>
295      <td><strong>i</strong></td>
296      <td>"y" may have been changed to "i."</td>
297    </tr>
298    <tr>
299      <td><strong>v</strong></td>
300      <td>the suffix means the verb form of pronunciation should be used.</td>
301    </tr>
302    <tr>
303      <td><strong>f</strong></td>
304      <td>the suffix means the next word is likely to be a verb.</td>
305    </tr>
306  </tbody>
307</table>
308</ul>
309<p>
310P&lt;number&gt; may be followed by additonal letters (eg. P3v ).
311
312<ul><table>
313  <tbody>
314    <tr>
315      <td><strong>t&nbsp;&nbsp;&nbsp;</strong></td>
316      <td>determine the stress pattern of the word <strong>before</strong> adding the prefix</td>
317    </tr>
318    <tr>
319      <td><strong>v</strong></td>
320      <td>the suffix means the verb form of pronunciation should be used.</td>
321    </tr>
322  </tbody>
323</table>
324</ul>
325
326<p>&nbsp;<hr>
327<h3>4.4  Pronunciation Dictionary List</h3>
328The <strong><em>&lt;language&gt;_list</em></strong>&nbsp;  file contains a list of words whose pronunciations are given explicitly, rather than determined by the Pronunciation Rules.
329The <strong><em>&lt;language&gt;_extra</em></strong>&nbsp; file, if present, is also used and it's contents are taken as coming after those in <strong><em>&lt;language&gt;_list</em></strong>.
330<p>
331Also the list can be used to specify the stress pattern, or other properties, of a word.
332<p>
333If the Pronunciation rules are applied to a word and indicate a standard prefix or suffix, then the word is again looked up in Pronunciation Dictionary List after the prefix or suffix has been removed.
334<p>
335Lines in the dictionary list have the form:
336<ul>
337&lt;word&gt; &nbsp; &nbsp;  [&lt;phoneme string&gt;] &nbsp; &nbsp;	[&lt;flags&gt;]
338</ul>eg.
339<pre>     book      bUk
340</pre>
341Rather than a full pronunciation, just the stress may be given, to change where it would be otherwise placed by the Pronunciation Rules:
342<pre>     berlin       $2      // stress on second syllable
343     absolutely   $3      // stress on third syllable
344     for          $u      // an unstressed word
345</pre>
346<h4>4.4.1 Multiple Words</h4>
347A pronunciation may also be specified for a group of words, when these appear together. Up to  four words may be given, enclosed in brackets.  This may be used for change the pronunciation or stress pattern when these words occur together,
348<pre>    (de jure)    deI||dZ'U@rI2   // note || used as a word break in the phoneme string</pre>
349or to run them together, pronounced as a single word
350<pre>    (of a)       @v@
351</pre>
352or to give them a flag when they occur together
353<pre>    (such as)    sVtS||a2z   $pause	   // precede with a pause
354</pre>
355<h4>4.4.2 Special characters in &lt;phoneme string&gt;:</h4>
356<ul><table>
357  <tbody>
358    <tr>
359      <td><strong>_^_&lt;language code&gt;&nbsp;&nbsp;&nbsp;</strong></td>
360      <td>Translate using a different language.  See explanation in 4.3.3 above.</td>
361    </tr>
362  </tbody>
363</table>
364</ul>
365<h4>4.4.3 Flags</h4>
366A word (or group of words) may be given one or more flags, either instead of, or as well as, the phonetic translation.
367
368<ul><table>
369  <tbody valign="top">
370    <tr>
371      <td>$u</td>
372      <td>The word is unstressed. In the case of a multi-syllable word, a slight stress is applied according to the default stress rules.</td>
373    </tr>
374    <tr>
375      <td>$u1</td>
376      <td>The word is unstressed, with a slight stress on its 1st syllable.</td>
377    </tr>
378    <tr>
379      <td>$u2</td>
380      <td>The word is unstressed, with a slight stress on its 2nd syllable.</td>
381    </tr>
382    <tr>
383      <td>$u3</td>
384      <td>The word is unstressed, with a slight stress on its 3rd syllable.</td>
385    </tr>
386    <tr>
387      <td>&nbsp;</td>
388      <td>&nbsp;</td>
389    </tr>
390    <tr>
391      <td>$u+ $u1+ $u2+ $u3+</td>
392      <td>As above, but the word has full stress if it's at the end of a clause.</td>
393    </tr>
394    <tr>
395      <td>&nbsp;</td>
396      <td>&nbsp;</td>
397    </tr>
398    <tr>
399      <td>$1</td>
400      <td>Primary stress on the 1st syllable.</td>
401    </tr>
402    <tr>
403      <td>$2</td>
404      <td>Primary stress on the 2nd syllable.</td>
405    </tr>
406    <tr>
407      <td>$3</td>
408      <td>Primary stress on the 3rd syllable.</td>
409    </tr>
410    <tr>
411      <td>$4</td>
412      <td>Primary stress on the 4th syllable.</td>
413    </tr>
414    <tr>
415      <td>$5</td>
416      <td>Primary stress on the 5th syllable.</td>
417    </tr>
418    <tr>
419      <td>$6</td>
420      <td>Primary stress on the 6th syllable.</td>
421    </tr>
422    <tr>
423      <td>$7</td>
424      <td>Primary stress on the 7th syllable.</td>
425    </tr>
426    <tr>
427      <td>&nbsp;</td>
428      <td>&nbsp;</td>
429    </tr>
430    <tr>
431      <td>$pause</td>
432      <td>Ensure a short pause before this word (eg. for conjunctions such as "and", some prepositions, etc).</td>
433    </tr>
434    <tr>
435      <td>$brk</td>
436      <td>Ensure a very short pause before this word, shorter than $pause (eg. for some prepositions, etc).</td>
437    </tr>
438    <tr>
439      <td>$only</td>
440      <td>The rule does not apply if a prefix or suffix has already been removed.</td>
441    </tr>
442    <tr>
443      <td>$onlys</td>
444      <td>As $only, except that a standard plural ending is allowed.</td>
445    </tr>
446    <tr>
447      <td>$stem</td>
448      <td>The rule only applies if a suffix has already been removed.</td>
449    </tr>
450    <tr>
451      <td>$strend</td>
452      <td>Word is fully stressed if it's at the end of a clause.</td>
453    </tr>
454    <tr>
455      <td>$strend2</td>
456      <td>As $strend, but the word is also stressed if followed only by unstressed word(s).</td>
457    </tr>
458    <tr>
459      <td>$unstressend&nbsp;</td>
460      <td>Word is unstressed if it's at the end of a clause.</td>
461    </tr>
462    <tr>
463      <td>$atend</td>
464      <td>Use this pronunciation if it's at the end of a clause.</td>
465    </tr>
466    <tr>
467      <td>$double</td>
468      <td>Cause a doubling of the initial consonant of the following word (used for Italian).</td>
469    </tr>
470    <tr>
471      <td>$capital</td>
472      <td>Use this pronunciation if the word has initial capital letter (eg. polish v Polish).</td>
473    </tr>
474    <tr>
475      <td>$allcaps</td>
476      <td>Use this pronunciation if the word is all capitals.</td>
477    </tr>
478    <tr>
479      <td>$dot</td>
480      <td>Ignore a . after this word even when followed by a capital letter (eg. Mr. Dr. ).</td>
481    </tr>
482    <tr>
483      <td>$abbrev</td>
484      <td>This has two meanings.<br> 1. If there is no phoneme string: Speak the word as individual letters, even if it contains a vowel (eg. "abc" should be spoken as "a" "b" "c").<br>2. If there is a phoneme string: This word is capitalized because it is an abbreviation and capitalization does indicate emphasis (if the "emphasize all-caps" is on).</td>
485    </tr>
486    <tr>
487      <td>&nbsp;</td>
488      <td>&nbsp;</td>
489    </tr>
490    <tr>
491      <td>$accent</td>
492      <td>Used for the pronunciation of a single alphabetic character.  The character name is spoken as the base-letter name plus the accent (diacritic) name.  eg. It can be used to specify that "&#xe2;" is spoken as "a" "circumflex".</td>
493    </tr>
494     <tr>
495      <td>$alt &nbsp; $alt2</td>
496      <td>These are language specific.  Their use should be described in the language's **_list file</td>
497    </tr>
498   <tr>
499    <tr>
500      <td>&nbsp;</td>
501      <td>&nbsp;</td>
502    </tr>
503    <tr>
504      <td>$verb</td>
505      <td>Use this pronunciation if it's a verb.</td>
506    </tr>
507    <tr>
508      <td>$noun</td>
509      <td>Use this pronunciation if it's a noun.</td>
510    </tr>
511    <tr>
512      <td>$past</td>
513      <td>Use this pronunciation if it's past tense.</td>
514    </tr>
515    <tr>
516      <td>$verbf</td>
517      <td>The following word is probably is a verb.</td>
518    </tr>
519    <tr>
520      <td>$verbsf</td>
521      <td>The following word is probably is a if it has an "s" suffix.</td>
522    </tr>
523    <tr>
524      <td>$nounf</td>
525      <td>The following word is probably not a verb.</td>
526    </tr>
527    <tr>
528      <td>$pastf</td>
529      <td>The following word is probably past tense.</td>
530    </tr>
531    <tr>
532      <td>$verbextend</td>
533      <td>Extend the influence of $verbf and $verbsf.</td>
534    </tr>
535  </tbody>
536</table></ul>
537The last group are probably English specific, but something similar may be useful in other languages. They are a crude attempt to improve the accuracy of pairs like  ob'ject (verb) v  'object (noun) and read (present) v read (past).
538<p>
539The dictionary list is searched from bottom to top.  The first match that satisfies any conditions is used (i.e. the one lowest down the list).  So if we have:
540<pre>
541    to    t@               // unstressed version
542    to    tu:   $atend     // stressed version
543</pre>
544then if "to" is at the end of the clause, we get [tu:], if not then we get [t@].
545
546<p>
547<h4>4.4.4  Translating a Word to another Word</h4>
548Rather than specifying the pronunciation of a word by a phoneme string, you can specify another "sounds like" word.<p>Use the attribute <b>$text</b>  eg.<p>
549<pre>
550    cough    coff   $text
551</pre>
552Alternatively, use the command <b>$textmode</b> on a line by itself to turn this on for all subsequent entries in the file, until it's turned off by <b>$phonememode</b>. eg.<p>
553<pre>
554    $textmode
555    cough     coff
556    through   threw
557    $phonememode
558</pre>
559This feature cannot be used for the special entries in the <b>_list</b> files which start with an underscore, such as numbers.<p>
560Currently "textmode" entries are only recognized for complete words, and not for for stems from which a prefix or suffix has been removed (eg. the word "coughs" would not match the example above).
561<p>
562
563<p>&nbsp;<hr>
564<h3>4.5  Conditional Rules</h3>
565Rules in a <b>_rules</b> file and entries in a <b>_list</b> file can be made conditional.  They apply only to some voices.  This can be useful to specify different pronunciations for different variants of a language (dialects or accents).<p>
566Conditional rules have &nbsp; <b>?</b> &nbsp; and a condition number at the start if the line in the <b>_rules</b> or <b>_list</b> file.  This means that the rule only applies of that condition number is specified in a <b>dictrules</b> line in the <a href="voices.html">voice file</a>.<p>
567If the rule starts with &nbsp; <b>?!</b> &nbsp; then the rule only applies if the condition number is <b>not</b> specified in the voice file. eg.<p>
568<pre>
569   ?3     can't     kant    // only use this if the voice has:  dictrules 3
570   ?!3    rather    rA:D3   // only use if the voice doesn't have:  dictrules 3
571</pre>
572
573<p>&nbsp;<hr>
574<h3>4.6  Numbers and Character Names</h3>
575<h4>4.6.1 Letter names</h4>
576The names of individual letters can be given either in the <b>_rules</b> or <b>_list</b> file.  Sometimes an individual letter is also used as a word in the language and its pronunciation as a word differs from its letter name.  If so, it should be listed in the <b>_list</b> file, preceded by an underscore, to give the letter name (as distinct from its pronunciation as a word).  eg. in English:
577<pre>   _a   eI</pre>
578<h4>4.6.2 Numbers</h4>
579The operation the TranslateNumber() function is controlled by the language's <code>langopts.numbers</code> option.  This constructs spoken numbers from fragments according to various options which can be set for each language.  The number fragments are given in the <b>_list</b> file.
580<p>
581<ul>
582<table><tbody align="left">
583<tr>
584<td>
585_0 to _9 &nbsp;
586<td>The numbers 0 to 9
587</tr>
588<tr>
589<td>_13<td>etc. Any pronunciations which are needed for specific numbers in the range _11 to _99 &nbsp;
590</tr>
591<tr>
592<td>_2X &nbsp;_3X<td>Twenty, thirty, etc., used to make numbers 10 to 99 &nbsp;
593</tr>
594<tr>
595<td>_nn<td>Any two digit numbers with a special pronunciation (eg. _15 "fifteen").
596</tr>
597<tr><TD>_0C<td>The word for "hundred"</td>
598<tr><TD>_1C &nbsp;_2C<td>Special pronunciation for one hundred, two hundred, etc., if needed.</tr>
599<tr><TD>_1C0<td>Special pronunciation (if needed) for 100 exactly</td>
600<tr><TD>_0M1<td>The word for "thousand"</tr>
601<tr><TD>_0M2<td>The word for "million"</tr>
602<tr><TD>_0M3<td>The word for 1000000000</tr>
603<tr><TD>_1M1 &nbsp;_2T1<td>Special pronunciation for one thousand, two thousand, tc, if needed</td>
604<tr><TD>_0and<td>Word for "and" when speaking numbers (eg. "two hundred and twenty").</tr>
605<tr><TD>_dpt<td>Word spoken for the decimnal point/comma</tr>
606<tr><TD>_dpt2<td>Word spoken (if any) at the end of all the digits after a decimal point.</tr>
607</tbody></table>
608</ul>
609
610<p>&nbsp;<hr>
611<h3>4.7  Character Substitution</h3>
612Character substitutions can be specified by using a <b> .replace </b> section at the start of the <b> _rules </b> file.  Each line specified either one or two alphabetic characters to be replaced by another one or two alphabetic characters.  This substitution is done to a word before it is translated using the spelling-to-phoneme rules.  Only the lower-case version of the characters needs to be specified.  eg.<p>
613 &nbsp; .replace<br>
614&nbsp; &nbsp; &#xf4; &nbsp; &#x151; &nbsp; // (Hungarian) allow the use of o-circumflex instead of o-double-accute<br>
615&nbsp; &nbsp; &#xfb; &nbsp; &#x171;<p>
616&nbsp; &nbsp; cx &nbsp; &#x109; &nbsp; // (Esperanto) allow "cx" as an alternative to c-circumflex<p>
617
618&nbsp; &nbsp; &#xfb01; &nbsp; fi &nbsp; // replace a single character ligature by two characters
619<p>
620
621
622</body>
623</html>