W3C home > Mailing lists > Public > www-voice@w3.org > October to December 2002

using form level grammars for field scope

From: Nick Alexander <NickA@tranXactive.com>
Date: Tue, 8 Oct 2002 15:50:11 +0200
Message-ID: <495BC761E1BBA449AC698C3FAE54527503FD44@txdell.tranxactive.com>
To: <www-voice@w3.org>
I'm experimenting with various mixed initiative scenarios based on  Vxml
2.0 spec and have run across a problem which needs some clarification
Is it possible to reference grammar rules, that are declared at form
scope, at field scope as demonstrated below? And is a specific access
modifier required on the rules
I would specifically like to use inline grammars.
 
Is this correct or would I need to modify the doc below ?
 
The example is as follows (doc also attached)
 
Thanks
 
Nick Alexander
enCue Labs
 
<?xml version="1.0" encoding="UTF-8"?>
<vxml xmlns="http://www.w3.org/2001/vxml" version="2.0">
       <form>
             <grammar root="order">
                    <rule id="order" scope="public">
                             I would like a
                            <ruleref uri="#drink"/>
                           <tag> drink.liquid=$drink.type;
drink.drinksize=$drink.drinksize</tag>
                           and
                            <ruleref uri="#pizza"/>
                           <tag> pizza=$pizza </tag>
                    </rule>
                    <!--kind of drink rule -->
                    <rule id="kindofdrink">
                           <one-of>
                                 <item> coke </item>
                                 <item> pepsi </item>
                                 <item> coca cola <tag> 'coke' </tag>
                                 </item>
                                 <!-- quote for string constant -->
                                 <!-- note tag sits inside item -->
                           </one-of>
                    </rule>
                    <!--food size rule -->
                    <rule id="foodsize">
                           <tag> 'medium' </tag>
                           <!-- no more need for NULL -->
                           <item repeat="0-1">
                                 <one-of>
                                        <item> small </item>
                                        <item> medium </item>
                                        <item> large </item>
                                        <item>
                                               <tag> 'medium' </tag>
regular </item>
                                 </one-of>
                           </item>
                    </rule>
                    <!--multiple toppings rule -->
                    <rule id="tops">
                           <ruleref uri="#top"/>
                           <tag> Append([],$top) </tag>
                           <item repeat="1-">
    and
    <ruleref uri="#top"/>
                                 <tag> Append($,$top)</tag>
                           </item>
                    </rule>
                    <rule id="top">
                           <one-of>
                                 <item> anchovies </item>
                                 <item> pepperoni </item>
                                 <item>
                                        <tag>'mushrooms'</tag> mushroom
</item>
                                 <item> mushrooms </item>
                           </one-of>
                    </rule>
                    <rule id="drink">
                           <ruleref uri="#foodsize"/>
                           <ruleref uri="#kindofdrink"/>
                           <tag> drinksize=$foodsize; type=$kindofdrink
</tag>
                    </rule>
                    <rule id="pizza">
                           <ruleref uri="#number"/>
                           <ruleref uri="#foodsize"/>
                           <tag> pizzasize=$foodsize; number=$number
</tag>
  pizzas with
  <ruleref uri="#tops"/>
                           <tag> topping=$tops </tag>
                    </rule>
                    <rule id="number">
                           <one-of>
                                 <item>
                                        <tag> 1 </tag>
                                        <one-of>
                                               <item> a </item>
                                               <item> one </item>
                                        </one-of>
                                 </item>
                                 <item>
                                        <tag>2</tag> two </item>
                                 <item>
                                        <tag>3</tag> three </item>
                           </one-of>
                    </rule>
             </grammar>
             <initial name="init_order">
                    <prompt>What you would like to order?</prompt>
                    <nomatch>Say something like a regular  coke and a
small pepperoni and mushroom pizza </nomatch>
                    <nomatch count="2">
                           <assign name="init_order" expr="true"/>
                    </nomatch>
             </initial>
             <field name="drink" modal="true">
                    <prompt>What kind of drink would you like</prompt>
                    <grammar root="drink"/>
             </field>
             <field name="pizza" modal="true">
                    <prompt>What type of pizza would you like</prompt>
                    <grammar root="pizza"/>
             </field>
             <filled mode="all" namelist="drink pizza">
                    <submit next="http://someDoc.vxml" method="post"/>
             </filled>
       </form>
</vxml>
 
Received on Tuesday, 8 October 2002 09:51:32 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 30 October 2006 12:48:56 GMT