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

Grammar error when testing ASR engine

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
zone24x7
Posts: 29
Joined: Fri May 19, 2006 7:50 am

Grammar error when testing ASR engine

Post by zone24x7 »

I used the following simple script to test ASR. Each time I tried, the server gave an error message indicating "error.inlinegrammar". (This is one of the samples given in programmer’s reference.)

<?xml version="1.0"?>
<vxml version="2.0">
<form>
<field name="myfield">

<grammar type="application/x-jsgf" mode="dtmf">
( 1 | 2 )+
</grammar>
<grammar type="application/srgs+xml" mode="speech">
( one | two )+
</grammar>
<prompt>
Say or enter any number of the digits one or two.
</prompt>
<filled>
You entered <value expr="myfield"/>.
</filled>
<nomatch>
You did not say or enter any ones or twos.
<reprompt/>
</nomatch>
<noinput>
You did not enter anything.
<reprompt/>
</noinput>
</field>
</form>
</vxml>


So I found the point where the error occurred. It’s in the second grammar tag. The value of the type attribute may be the cause for the error.

While the script worked fine when the grammar type was set to”application/x-jsgf” and mode was "dtmf" , It didn’t run when the grammar type was set to "application/srgs+xml" and mode as “speech”.

1. Can you please let me know whether there are any errors in the code?

2. If the above code is correct, can you please let me know a way to run above code in our plum server?
Do I need to configure settings of ASR to run the above code?

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

You can use type="application/x-jsgf" for both IVR

Post by support »

Hello,

You are confusing grammar format with grammar purpose. JSGF and SRGS+XML are formats that instruct the IVR grammer and speeech engine how to determine a match against user input. You can use either of these formats for speech or dtmf, there is no restriction here. The mode of the IVR grammar tells the IVR engine that the grammar will be used for matching speech or matching dtmf this restricts the type of data that can be in an IVR grammar (i.e. - there is no dtmf button for the word "one"). You can therefore use type="application/x-jsgf" for both IVR grammars:

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">
  <form>
    <field name="myfield">
      <grammar type="application/x-jsgf" mode="dtmf">
        ( 1 | 2 )+
      </grammar>
      <grammar type="application/x-jsgf" mode="speech">
        ( one | two )+
      </grammar>
      <prompt>
        Say or enter any number of the digits one or two.
      </prompt>
      <filled>
        You entered <value expr="myfield"/>.
      </filled>
      <nomatch>
        You did not say or enter any ones or twos.
        <reprompt/>
      </nomatch>
      <noinput>
        You did not enter anything.
        <reprompt/>
      </noinput>
    </field>
  </form>
</vxml>
Hope this helps.

Regards,
Plum Support

Post Reply