We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

Built in grammars not working in french

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
jdart
Posts: 17
Joined: Wed Jul 30, 2008 1:09 pm

Built in grammars not working in french

Post by jdart »

Consider the following vxml:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.0">
<!-- Test App: French -->

    <var name="xmllang" expr="'en-us'" />

    <!-- Set Lang to French -->

    <form id="form_32">
        <block>
            <assign name="xmllang" expr="'fr-ca'" />
            <goto next="#form_52" />
        </block>
    </form>

    <!-- Yesno -->

    <form id="form_52">

        <property name="sensitivity" value="0.3"/>
        <property name="confidencelevel" value="0.6"/>
        <field name="field_52" type="boolean">
            <property name="inputmodes" value="voice" />

            <prompt cond="xmllang=='fr-ca'" xml:lang="fr-ca" bargein="true">
                Oui ou non?
            </prompt>

            <filled>
                <goto next="#end" />
            </filled>
        </field>
    </form>

    <form id="form_end">
        <block>
            Goodbye.
        </block>
    </form>

</vxml>
I can't get this to recognize 'oui', only 'yes'. I have the same problem with the built in number grammar, it doesn't recognize french numbers, only english.

What am I doing wrong?

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

IVR code for French grammar

Post by support »

Hi,

You can use the following sample IVR code to help you achieve this. Note how the IVR <grammar> is implemented.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.0">

    <form id="form_52">

        <property name="sensitivity" value="0.3"/>
        <property name="confidencelevel" value="0.6"/>
        <field name="field_52">
            <property name="inputmodes" value="voice" />
            <grammar type="application/srgs+xml" root="ROOT2" mode="voice" xml:lang="fr-CA">
              <rule id="ROOT2">
                <one-of>
                  <item>oui<tag>answer='oui'</tag></item>
                  <item>non<tag>answer='non'</tag></item>
                </one-of>
              </rule>
            </grammar>

            <prompt>
              <speak xml:lang="fr-CA"><voice name="Julie" gender="female">
                Oui or non?
              </voice></speak>
            </prompt>

            <filled>
              <prompt>
                <speak xml:lang="fr-CA"><voice name="Julie" gender="female">
                  Je parle <value expr="field_52"/>.
                </voice></speak>
              </prompt>
                <goto next="#form_end" />
            </filled>
        </field>
    </form>

    <form id="form_end">
        <block>
            Goodbye.
        </block>
    </form>

</vxml>
Hope this helps.

Regards,
Plum Support
Last edited by support on Wed Feb 17, 2010 11:52 am, edited 4 times in total.

jdart
Posts: 17
Joined: Wed Jul 30, 2008 1:09 pm

Post by jdart »

Does this mean that the built in grammars only work for English? Do I have to do something like this to recognize numbers, dollars, etc... This makes it difficult to make a single vxml file that supports multiple languages.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Built-in IVR grammars can be used for different languages

Post by support »

No, these built-in IVR grammars can be used for different languages as well.

For IVR example, for digits, note how we use the IVR tags, <speak> and <voice>, for the languages:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.0" xml:lang="fr-CA">

<form id="french">
<field name="answer" type="digits">

<prompt>
  <speak xml:lang="fr-CA"><voice name="Julie" gender="female">
    Choisissez un nombre.
  </voice></speak>
</prompt>

<filled>
  <prompt>
    <speak xml:lang="fr-CA"><voice name="Julie" gender="female">
      Tu parle <value expr="answer"/>.
    </voice></speak>
  </prompt>
</filled>
</field>
</form>
</vxml>
Sorry for not providing this IVR example earlier.

Regards,
Plum Support
Last edited by support on Wed Feb 24, 2010 2:48 pm, edited 5 times in total.

jdart
Posts: 17
Joined: Wed Jul 30, 2008 1:09 pm

Post by jdart »

In order for the built in grammars to work does the vxml tag property xml:lang have to be set? Is there any way to change the language part way through a vxml file?

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

IVR code for built-in grammar

Post by support »

Hi,

You could also implement your builtin IVR <grammar>, digits, in the following way:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.0" xml:lang="fr-CA">

<form id="french">
<field name="answer">
<grammar xml:lang="fr-CA" src="builtin:grammar/digits"/>
<prompt>
  <speak xml:lang="fr-CA"><voice name="Julie" gender="female">
    Choisissez un nombre.
  </voice></speak>
</prompt>

<filled>
  <prompt>
    <speak xml:lang="fr-CA"><voice name="Julie" gender="female">
      Tu parle <value expr="answer"/>. 
    </voice></speak>
  </prompt>
</filled>
</field>
</form>
</vxml>
Hope this helps.

Regards,
Plum Support
Last edited by support on Tue Jan 12, 2010 3:59 pm, edited 3 times in total.

jdart
Posts: 17
Joined: Wed Jul 30, 2008 1:09 pm

Post by jdart »

What about Extended Built-in Grammars? Can you specify a language to use with them? I'm not having any luck. Example:

Code: Select all

<grammar src="http://10.10.1.1/imi/vxml/grammars/firstnames.php"
    root="first" 
    type="application/srgs+xml"
    mode="voice"
    xml:lang="fr-ca"
/>

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

IVR grammars not intended for multilingual purposes

Post by support »

Hi,

Our extended built-in IVR grammars weren't intended to be used for multilingual purposes, so this might explain why some names are coming up as nomatches when you try to speak them.

For example, let's take the name Robert. In English, you would pronounce the name as Rob-ert. However, in French, the name might be pronounced as Roe-bear. This is the reason why the IVR speech recognition engine is having a difficult time understanding the name that is being said.

I would recommend that you create an IVR grammar designed specifically for recognizing French-Canadian names. That way, you could use both IVR grammars within your IVR application for recognizing English-sounding names and French-sounding names.

Regards,
Plum Support

Post Reply