Browse Ask a Question
 
Tools Add
Rss Categories

Using Phonetic Spellings

Reference Number: AA-01064 Views: 1123 0 Rating/ Voters

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:

ABNF Format:
$either = "{AY DH AXR}" | "{IY DH AXR}";
GrXML Format:
<rule id="either">
    <one-of>
        <item>"{AY DH AXR}"</item>
        <item>"{IY DH AXR}"</item>
    </one-of>
</rule>

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.

ABNF Format:
$either = "{AY DH AXR:either}" | "{IY DH AXR:either}";
GrXML Format:
<rule id="either">
    <one-of>
        <item>"{AY DH AXR}:either"</item>
        <item>"{IY DH AXR}:either"</item>
    </one-of>
</rule>

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 Format:
#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"};
GrXML Format:
<?xml version="1.0" encoding="UTF-8" ?>
<grammar xmlns="http://www.w3.org/2001/06/grammar"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.w3.org/2001/06/grammar
                             http://www.w3.org/TR/speech-grammar/grammar.xsd"
         xml:lang="es-MX" version="1.0"
         root="main"
         mode="voice"
         tag-format="semantics/1.0">

<!-- This is an example name grammar with semantic interpretation tags -->

<rule id="main">
    <one-of>
        <item>"{K R EY D IY T OW:crédito}"<tag>crédito</tag></item>
        <item>Sí<tag>Sí</tag></item>
        <item>
            <one-of>
                <item>el baño</item>
                <item>"{EY L BV AA GN OW}"</item>
            </one-of><tag>el baño</tag>
        </item>
        <item>hola<tag>hola</tag></item>
    </one-of>
</rule>

</grammar>

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.

Rss Comments
  • There are no comments for this article.
Info Add Comment
Nickname: Your Email: Subject: Comment:
Enter the code below:
Info Ask a Question