Grammar error when testing ASR engine
Posted: Tue Jun 20, 2006 4:42 am
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?
<?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?