There are two separate methods for translating words into phonemes:
The utility 'phonemes' are:
' | primary stress |
, | secondary stress |
% | unstressed syllable |
= | put the primary stress on the preceding syllable |
_: | short pause |
_ | a shorter pause |
|| | indicates a word boundary within a phoneme string |
| | can be used to separate two adjacent characters, to prevent them from being considered as a multi-character phoneme mnemonic |
The phonemes which are used to represent a language's sounds are based on the Kirschenbaum ascii character representation of the International Phonetic Alphabet www.kirschenbaum.net/IPA/ascii-ipa.pdf
To 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.
.group o o 0 // "o" is pronounced as [0] oo u: // but "oo" is pronounced as [u:] b) oo (k U"oo" is pronounced as [u:], but when also preceded by "b" and followed by "k", it is pronounced [U].
In the case of a single-letter group, the first character of <match> much be the group letter. In the case of a 2-letter group, the first two characters of <match> must be the group letters. The second and third rules above may be in either .group o or .group oo
Alphabetic characters in the <pre>, <match>, and <post> parts must be lower case, and matching is case-insensitive. Some upper case letters are used in <pre> and <post> with special meanings.
_^_<language code> | Translate using a different language. |
th (_ _^_ENindicates that a word which ends in "th" is translated using the English translation rules and spoken with English phonemes.
_ | beginning or end of a word |
A | any vowel (set set of vowel characters may be defined for a particular language) |
B | any hard consonant (not h,r,w) - may be defined differently for a particular language |
C | any consonant |
D | any digit |
E F G | may indicate other sets of characters (defined for a particular language) |
K | not a vowel (i.e. a consonant or pause or non-alphabetic character) |
Z | a non-alphabetic character |
% | doubled (placed before a character in <pre> and after it in <post> |
/ | following character is treated literally |
_) a // "a" at the start of a word a (CC // "a" followed by two consonants a (C% // "a" followed by a double consonant (the same letter twice) a (/% // "a" followed by a percent sign %C) a // "a" preceded by a double consonants
@ | any syllable |
& | a syllable which may be stressed (i.e. is not defined as unstressed) |
@@) bi // "bi" preceded by at least two syllables @@a) bi // "bi" preceded by at least 2 syllables and following 'a'Note, that matching characters in the <pre> part do not affect the syllable counting.
@ | a vowel follows somewhere in the word |
+ | force an increase in the score in this rule (may be repeated for more effect) |
S<number> | this number of matching characters are a standard suffix, remove them and retranslate the word. |
P<number> | this number of matching characters are a standard prefix, remove them and retranslate the word. |
N | only use this rule if the word is not a retranslation after removing a suffix |
# | (English specific) change the next "e" into a special character "E" |
@) ly (_$2 lI // "ly", at end of a word with at least one other // syllable, is a suffix pronounced [lI]. Remove // it and retranslate the word. _) un (@P2 ¬Vn // "un" at the start of a word is an unstressed // prefix pronounced [Vn] _) un (i ju: // ... except in words starting "uni" _) un (inP2 ,Vn // ... but it is for words starting "unin"S and P must be at the end of the <post> string.
S<number> may be followed by additonal letters (eg. S2ei ). These are probably specific to English, but similar functions could be added for other languages.
d | the previous letter may have been doubled when the suffix was added |
e | "e" may have been removed |
i | "y" may have been changed to "i" |
v | the suffix means the verb form of pronunciation should be used |
f | the suffix means the next word is likely to be a verb |
Also the list can be used to specify the stress pattern, or other properties, of a word.
If 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.
Lines in the dictionary list have the form:
book bUkRather than a full pronunciation, just the stress may be given, to change where it would be otherwise placed by the Pronunciation Rules:
berlin $2 // stress on second syllable absolutely $3 // stress on third syllable for $u // an unstressed word
(de jure) deI||dZ'U@rI2 // note || used as a word break in the phoneme stringor to run them together, pronounced as a single word
(of a) @v@or to give them a flag when they occur together
(such as) sVtS||a2z $pause // precede with a pause
_^_<language code> | Translate using a different language. See explanation in 4.3.3 above. |
$u | The word is unstressed |
$1 | Primary stress on the first syllable |
$2 | Primary stress on the second syllable |
$3 | Primary stress on the third syllable |
$4 | Primary stress on the fourth syllable |
$5 | Primary stress on the fifth syllable |
$pause | Ensure a short pause before this word (eg. for conjunctions such as "and") |
$only | The rule does not apply if a prefix or suffix has already been removed. |
$onlys | As $only, except that a standard plural ending is allowed |
$strend | Word is fully stressed if it's at the end of a clause. |
$strend2 | As $strend, but the word is also stressed if followed by only unstressed word(s) |
$unstressend | Word is unstressed if it's at the end of a clause |
$atend | Use this pronunciation if it's at the end of a clause |
$capital | Use this pronunciation if word has initial capital letter (eg. polish v Polish) |
$dot | Ignore a . after this word even when followed by a capital letter (eg. Mr. Dr. ) |
$abbrev | Never speak this word as individual letters (eg, Roman numerals III, IV ) |
$verb | Use this pronunciation if it's a verb |
$past | Use this pronunciation if it's past tense |
$verbf | The following word is probably is a verb |
$verbsf | The following word is probably is a if it has an "s" suffix |
$nounf | The following word is probably not a verb |
$pastf | The following word is probably past tense |
$verbextend | Extend the influence of $verbf and $verbsf |
The 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:
to t@ // unstressed version to tu: $atend // stressed versionthen if "to" is at the end of the clause, we get [tu:], if not then we get [t@].