Page 1 of 1

Spanish IVR equivalent

Posted: Wed Sep 04, 2013 12:08 pm
by w2gi
Hi,

We need the Spanish voice input grammar equivalent for the following English grammar tags:

Code: Select all

<grammar type="application/x-jsgf" mode="voice">
    ( one | two )+
</grammar>
---------------------------------------------

   <field name="chosen" type="uscitystate">
      <prompt bargein="false">
		 Please tell your city and state.
      </prompt>
	  
      <filled>
		 <assign name="input_city" expr="chosen.city" />
		 <assign name="input_state" expr="chosen.state" />
		 <goto next="#getStreet" />
      </filled>
----------------------------------------------

      <grammar srcexpr="'http://vxml.plumgroup.com/grammars/usstreetaddress.php?city='+escape(input_city)+'&state='+escape(input_state)" 
	     root="usstreet" type="application/srgs+xml" mode="voice" />
Also, do you have any Spanish voice based IVR as an example to refer?

Thanks,
Mani

Re: Spanish IVR equivalent

Posted: Thu Sep 05, 2013 10:58 am
by support
Hi Mani,

For all your grammar tags, you will need the xml:lang attribute to specify whether you want it in English or Spanish. So this is what your 1st grammar would be like:

Code: Select all

    <grammar type="application/x-jsgf" xml:lang="es-MX" mode="voice" >
      ( 1 | 2 )+
    </grammar>
The xml:lang specifies you want this grammar in Spanish. Also, we use 1 and 2 instead of "one" and "two", because they are not English specific.

For your second grammar, you must define it with a <grammar> tag, so you can specify the language, like this:

Code: Select all

<field name="chosen">
    <grammar src="builtin:uscitystate" xml:lang="es-MX" mode="voice" />
Keep in mind, for these address grammars, we do not translate the street/city/state names. So it would recognize "New York" in a Spanish accent, but not "Nueva York."

We are still finalizing the code example for your third grammar, we'll be posting it shortly. Thanks for your patience.

Re: Spanish IVR equivalent

Posted: Thu Sep 05, 2013 12:00 pm
by support
Hi Mani,

Unfortunately, our built in US street address grammar is English only. We apologize for the misunderstand and we will update our documentation to reflect this.

Re: Spanish IVR equivalent

Posted: Tue Sep 17, 2013 1:17 pm
by w2gi
Hi,

Per your response, I tried the following:

Code: Select all

<form id="getZipCodeSpanish">
   <field name="chosen">
      <grammar type="application/x-jsgf" xml:lang="es-MX" mode="voice">
	     ( 1 | 2 )+
	  </grammar>
      <prompt bargein="false">
         <audio src="..."></audio>
      </prompt>
	  
      <filled>
         <assign name="address" expr="chosen" />
		 <prompt bargein="false">
		    <audio src="..."></audio>
			<say-as type="acronym"><value expr="address" /></say-as>
		 </prompt>
		 <goto next="#confirmationSpanish" />
      </filled>
and it always throws nomatch error.

Can you please provide an example of how to get the zipcode in Spanish?

Thanks,
Mani

Re: Spanish IVR equivalent

Posted: Tue Sep 17, 2013 4:36 pm
by support
Hi Mani,

Looking at the code you posted, I was able to get a match by speaking 'uno' or 'dos'. I only removed the <audio> tags and added the closing </field> and </form> tags, but otherwise the code you posted would recognize 'uno' or 'dos' as valid input.

Code: Select all

<form id="getZipCodeSpanish">
   <field name="chosen">
      <grammar type="application/x-jsgf" xml:lang="es-MX" mode="voice">
        ( 1 | 2 )+
     </grammar>
      <prompt bargein="false">
         Enter one or two.
      </prompt>
    
      <filled>
         <assign name="address" expr="chosen" />
       <prompt bargein="false">
          you entered.
         <say-as type="acronym"><value expr="address" /></say-as>
       </prompt>
       <goto next="#confirmationSpanish" />
      </filled>
    </field>
</form>
Are you trying to have the user input a full zip code spoken in spanish, or have them speak 'uno' or 'dos' to make a selection, as the script is currently doing?

Please let us know so that we can better assist you with this issue.

Regards,
Plum Support

Re: Spanish IVR equivalent

Posted: Tue Sep 17, 2013 11:16 pm
by w2gi
Thanks for your response.

Can you please verify the VXML configured on the number "617-712-3999 x 1892"? It is in scratchpad. The Spanish part starts from the comment "Spanish INTRO" in the VXML. Please search for this comment and let me know the problems with the <form id="getZipCodeSpanish"> part.

Let me know if you need more details.

Thanks again,
Mani

Re: Spanish IVR equivalent

Posted: Wed Sep 18, 2013 11:08 am
by support
Hi Mani,

After looking at your code, in order to match a zip code with spoken Spanish, you could do something like the following:

Code: Select all

    <property name="termmaxdigits" value="true"/>
    <property name="interdigittimeout" value="5s" />

    <field name="chosen" type="digits?length=5">
      <grammar type="application/x-jsgf" xml:lang="es-MX" mode="voice">
        ( cero | uno | dos | tres | cuatro | cinco | seis | siete | ocho | nueve ) +
      </grammar>
Setting the termmaxdigits property will allow you to specify the type option for the <field> element, which will specify that a certain amount of digits are required. The grammar should then recognize exactly five of any spoken Spanish digits 0 - 9.

Hope that helps! Please feel free to let us know if you have any additional questions.

Regards,
Plum Support

Re: Spanish IVR equivalent

Posted: Wed Sep 18, 2013 12:54 pm
by w2gi
Thanks again for your help.

If you check the test number "617-712-3999 x1892" again, I have removed all other VXMl tags and left only the getZipCodeSpanish form for easy testing.

If you check this VXML, I am trying to get the Spanish zipcode and repeating it with <say-as type="acronym"><value expr="address" /></say-as>. But, it is not repeating as single digits in Spanish. It repeats fastly and in English slang.

Also, after receiving the Spanish zipcode voice input, I want to translate it to English regular numbers (i.e., zipcode in English). So, that I can do further process. How can I do this translation from Spanish zip code to English?

Please do the needful.

Thanks a lot,
Mani

Re: Spanish IVR equivalent

Posted: Wed Sep 18, 2013 3:09 pm
by support
Hi Mani,

This code snippet should answer your question.

This will assign the variable 'address' the numbers entered (i.e. zipcode in English) so you can further process them, and the <value expr="chosen.toString().replace(/(.)/g, '$1, ')"/> will repeat to the user the digits they entered in Spanish.

Code: Select all

<form>
	<field name="chosen" type="digits?length=5">
		<prompt bargein="false">
			<audio src="http://ivr.where2getit.com/coopfinancial/ivr/prompts/new/Spanish_4.wav"></audio>
		</prompt>

		<filled>
			<assign name="address" expr="chosen" />
			<prompt>
				<audio src="http://ivr.where2getit.com/coopfinancial/ivr/prompts/new/Spanish_5.wav"></audio>
				<speak xml:lang="es-MX"><voice name="Javier">
					<value expr="chosen.toString().replace(/(.)/g, '$1, ')"/>
				</voice></speak>
			</prompt>
		</filled>
	</field>
</form>
Hope that helps!

Regards,
Plum Support