Page 1 of 1

how to use <tag/> in grammar

Posted: Tue Apr 04, 2006 5:42 pm
by kmanley
Hi,

Can you please help me with the sample below? The syntax within the <tag> element works on some other voicexml platforms but doesn't seem to work the same way on the Plum platform.

The sample as-is doesn't work, it always causes the nomatch handler to be invoked. If I remove the <tag>, then recognition works but of course the references to dt.month and dt.day don't.

(Note that I'm aware there is a built in grammar for dates. I'm trying to understand the larger issue of how <tag> is supported by Plum.)

Thanks,
Kevin
<?xml version="1.0" encoding="ISO-8859-1"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">

<form id="start">

<field name="dt">

<grammar version="1.0" root="main" type="application/srgs+xml" xml:lang="en">

<rule id="main" scope="public">
<item>
<ruleref uri="#month"/>
<ruleref uri="#day"/>
</item>

<tag> $.month = $month; $.day = $day; </tag>

</rule>

<rule id="month">
<one-of>
<item>May</item>
<item>June</item>
<item>October</item>
</one-of>
</rule>

<rule id="day">
<one-of>
<item>first</item>
<item>second</item>
<item>third</item>
</one-of>
</rule>

</grammar>

<prompt>Please say a date</prompt>

<filled>
<prompt>
I think you said month <value expr="dt.month"/> day <value expr="dt.day"/>.
</prompt>
<clear namelist="dt"/>
</filled>

<nomatch>
I'm sorry, I didn't catch that.
<reprompt/>
</nomatch>
</field>

</form>

</vxml>

Plum IVR sys supports certain grammar formats

Posted: Wed Apr 05, 2006 4:22 pm
by support
Hello,

The Plum IVR system does not currently support the IVR grammar format you are refering to. You can get access to similar capabilities by using the following IVR format:

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">

<form id="start">

<field name="dt">

<grammar version="1.0" root="main" type="application/srgs+xml" xml:lang="en" mode="voice">

<rule id="main" scope="public">
<item>
<ruleref uri="#month"/>
<ruleref uri="#day"/>
</item>
<tag> month = month.SWI_literal; day = day.SWI_literal; </tag>
</rule>

<rule id="month">
<one-of>
<item>May</item>
<item>June</item>
<item>October</item>
</one-of>
</rule>

<rule id="day">
<one-of>
<item>first</item>
<item>second</item>
<item>third</item>
</one-of>
</rule>

</grammar>

<prompt>Please say a date</prompt>

<filled>
<prompt>
I think you said month <value expr="application.lastresult$[0].slots.month"/> day <value expr="application.lastresult$[0].slots.day"/>.
</prompt>
<clear namelist="dt"/>
</filled>

<nomatch>
I'm sorry, I didn't catch that.
<reprompt/>
</nomatch>
</field>

</form>

</vxml>
Plum is working to support the Semantic Interpretation for Speech Recognition(SISR) 1.0 which is still in the working draft stage. At this point any slots that do not match a form level variable are placed in the application.lastresult$[].slots.<key>. This was done as an interim solution until the SISR becomes formalized.

Regards,
Plum Support

Posted: Thu Apr 06, 2006 9:25 am
by kmanley
that is very helpful, thanks!
Is this documented anywhere?
Thanks, Kevin