sound.speech.g2p

index ยท sound.speech

Overview

English grapheme-to-phoneme for sound.speech. Two layers; the first match wins:

  1. A dictionary of common irregular words, with real stress marks (ARPAbet, with stress digits 0, 1 or 2 on the vowels).
  2. Letter-to-sound rules in the NRL formalism (Elovitz et al. 1976). A rule A[B]C=PH PH ... turns the letters B, between left context A and right context C, into the listed phonemes. The first matching rule wins and the cursor moves past B. The rule set is written in that formalism, not copied from NRL. It reads about 90% of ordinary text right; the dictionary catches the worst of the rest.

Context 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

The rules carry no stress. A word the rules spell gets primary stress on its first vowel. Put a word the rules mangle into the dictionary, or write its events by hand for sound.speech.synth.

Functions

NameSignature
wordword(w) -> events

word(w) -> events

Transcribe one lowercase word into phoneme events

Returns a list of { ph, stress }. The dictionary is tried first, with the word's apostrophes and then without. Otherwise the rules spell the word, with primary stress on the first vowel.