Using Phonetic Spellings

Within an SRGS grammar, you can specify pronunciations of words using phonemes. Phonemes are the basic sounds that make up words. Specifying pronunciations this way is useful for adding alternative pronunciations to help deal with some proper names and to help support dialects or even foreign words.

To add a phonetic spelling to a rule, enclose the phonetic spelling within double quotation marks " " and curly braces { }.

For instance, the word "either" is commonly pronounced in two ways. One has a long I sound at the start (eye-ther) while the other starts with a long E sound (ee-ther). Broken into their phonemes, these two variants would be spelled as AY DH AXR and IY DH AXR.

A rule that contained the two variants of the word "either" might look like this:

$either = "{AY DH AXR}" | "{IY DH AXR}";

A rule set up like this, however, will only return the phonemes if the rule is matched. If you want to get the actual word returned as raw text by the Engine, you need to enclose the word within the quotation marks and curly braces, but separate it from the phonemes with a colon.

$either = "{AY DH AXR:either}" | "{IY DH AXR:either}";

Note that adding phonetic spellings is distinct from semantic interpretation, even though both use curly braces in ABNF (the curly braces for a phonetic spelling are always inside of double quotation marks).

Here is a Spanish grammar that uses these principles:

#ABNF 1.0 ISO-8859-1;
/*
* This is an example name grammar
* with semantic interpretation tags.
*/

language es-MX;
mode voice;
root $main;
tag-format <semantics/1.0>

public $main = "{K R EY D IY T OW:crédito}" {out="crédito"} //custom pronunciation
| Sí {out="Sí"} | (("el baño") | "{EY L BV AA GN OW}") {out="el baño"} | hola {out="hola"};

For a common application of phonetic spellings, see Adding Foreign Words. Our three-part video series on phonetic spellings may also give you a good idea of how this works.

© 2012 LumenVox LLC. All rights reserved.