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

how to use <tag/> in grammar

Questions and answers about Plum iOn systems

Moderators: admin, support

Post Reply
kmanley
Posts: 6
Joined: Thu Mar 16, 2006 3:47 pm
Location: London, UK

how to use <tag/> in grammar

Post 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>

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

Plum IVR sys supports certain grammar formats

Post 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
Last edited by support on Fri Feb 26, 2010 1:54 pm, edited 4 times in total.

kmanley
Posts: 6
Joined: Thu Mar 16, 2006 3:47 pm
Location: London, UK

Post by kmanley »

that is very helpful, thanks!
Is this documented anywhere?
Thanks, Kevin

Post Reply