English grapheme-to-phoneme for the formant TTS (sound.speech).
Two layers, exceptions first:
Context pattern symbols:
# one or more vowels (a e i o u y) : zero or more consonants
^ exactly one consonant . a voiced consonant (bdvgjlmnrwz)
+ a front vowel (e i y) & a sibilant (s c g z x j ch sh)
@ t s r d l z n j th ch sh % a suffix (e er es ed ing ely)
(space) word boundary other letters match literally
Rules give no stress; a heuristic marks the first vowel of a rule-derived word as primary. Words the rules mangle badly belong in the dictionary — or can be phonemized by hand via the events API (sound.speech.synth).
| Name | Signature |
|---|---|
| word | word(w) -> events |
word(
w) ->events
Transcribe one lowercase word into phoneme events
Returns a list of { ph = <ARPAbet>, stress = 0|1|2 }. The exceptions
dictionary is consulted first (with, then without, apostrophes); otherwise
the letter-to-sound rules run with the first-vowel stress heuristic.