Re: Matching a choice grammar

Hi Rajesh,

My point of view is that there is no rationale to distinguish menu grammars 
from <choice>'s local grammars. The only grammars that can appear within 
the menu subtree are the grammars related to the <choice> elements. These 
grammars are either explicitly stated in the <choice> element, or they are 
generated by the platform (let's call them implicit). Thus omission of the 
grammar is just a syntactic shorthand in the case one does not need a 
detailed control over the grammar.

 From this perspective, it seems to be illogical to allow the explicit 
grammars to have the document scope while deny the same for the implicit 
ones (or vice versa).

Could somebody authorized comment on this issue?

Thanks,

    Pavel


Rajesh N wrote:
> Hi Pavel,
> 
>  
> 
> Thanks a lot for your inputs.
> 
>  
> 
> The doubt is whether a <grammar> element, which is a child of a <choice> 
> of a <menu>, should be considered as a menu grammar or as choice’s local 
> grammar.
> 
>  
> 
> If it is to be considered as a menu grammar, then the scope=document 
> applies to it, and the behavior should be as you have clarified (like 
> the way Optimtalk works).
> 
>  
> 
> However, if it is not to be considered as a menu grammar, and just be 
> treated as <choice>’s local grammar, then the behavior should be as per the
> 
> /“else if ( the utterance matched a grammar belonging to a <choice> )”/
> 
> branch of Appendix C.
> 
>  
> 
> It would be great if some more voices are heard on this issue.
> 
>  
> 
> Thanks
> 
> Rajesh
> 
>   
> 
>  
> 
> This e-mail and attachments contain confidential information from 
> HUAWEI, which is intended only for the person or entity whose address is 
> listed above. Any use of the information contained herein in any way 
> (including, but not limited to, total or partial disclosure, 
> reproduction, or dissemination) by persons other than the intended 
> recipient's) is prohibited. If you receive this e-mail in error, please 
> notify the sender by phone or email immediately and delete it!
> 
> ------------------------------------------------------------------------
> 
> *From:* Pavel Cenek [mailto:cenek@optimsys.cz]
> *Sent:* Tuesday, April 21, 2009 3:42 PM
> *To:* Rajesh N
> *Cc:* www-voice@w3.org; ranjit@hauwei.com
> *Subject:* Re: Matching a choice grammar
> 
>  
> 
> Hi Rajesh and Puneet,
> 
> Let me comment on your question.
> 
> I believe that after providing the 5567 input in the second scenario, 
> FIA should jump to the menu, consequently
> the formVar in the form's scope will be inaccessible and error.semantic 
> will be thrown. This seems to me to be the logical behavior and this is 
> how our VoiceXML platform OptimTalk behaves.
> 
> Also, when you look into the VoiceXML 2.0 conformance test suite, the 
> assertion no 1085 states:
> /If a document scope menu grammar is matched while processing another
> form and the matched <choice> element's event or eventexpr is thrown
> and the event handler does not transition to a new form, the FIA
> resumes in the <menu> after clearing the menu's anonymous form
> item variable./
> This suggests that the interpreter must have tranistioned to the menu 
> before processing the event.
> 
> I find the cited formulation in Appendix C misleading. However, I am not 
> sure about the motivation for the
> 
> else if ( the utterance matched a grammar belonging to a <choice> )
> 
> branch. For this particular use case it seems that simply removing it 
> would solve the problem. However, there is probably a good reason for 
> having it there. Anyway, it seems to me that a fix will be necessary here.
> 
> Regards,
> 
>    Pavel
> 
> 
> -- 
> 
>       Pavel Cenek, CEO
> 
>       OptimSys, s.r.o.
> 
>       cenek@optimsys.cz <mailto:cenek@optimsys.cz>
> 
>       Tel: +420 541 143 065
> 
>       Fax: +420 541 143 066
> 
>       http://www.optimsys.cz
> 
> 
> Rajesh N wrote:
> 
> Hi,
> 
>  
> 
> The following VXML script and couple of execution logs attached 
> supplements Puneet’s earlier query.
> 
> Kindly go through the same and provide your suggestions.
> 
>  
> 
> *_VoiceXML script:_*
> 
>  
> 
> <?xml version="1.0" ?>
> 
> <vxml xmlns="http://www.w3.org/2001/vxml" version="2.0">
> 
>  
> 
>  <property name="inputmodes" value="dtmf voice" />
> 
>  
> 
>   <catch event="error.semantic">
> 
>     <log> In error.semantic event handler </log>
> 
>     <exit/>
> 
>   </catch>
> 
>  
> 
>   <catch>
> 
>     <log> In generic event handler, event caught is <value 
> expr="_event"/> </log>
> 
>     <log> In generic event handler, variable formVar is  <value 
> expr="formVar"/> </log>
> 
>     <exit/>
> 
>   </catch>
> 
>  
> 
>   <*menu* dtmf="true" scope="document">
> 
>     <prompt> Welcome to menu </prompt>
> 
>     <*choice* event="myEvent1">
> 
>        first 
> 
>        <grammar src="builtin:dtmf/digits?length=4" />
> 
>     </choice>
> 
>     <*choice* dtmf="0" next="#form2" />
> 
>     <*choice* event="myEvent2" />
> 
>   </menu>
> 
>  
> 
>   <*form* id="form2">
> 
>     <var name="*formVar*" expr="100" />    
> 
>  
> 
>     <*field* name="field2" modal="false">
> 
>       <grammar version="1.0" root="digit" type="application/srgs+xml" 
> mode="dtmf">
> 
>         <rule scope="public" id="digit">
> 
>           <one-of>
> 
>             <item>666</item>
> 
>             <item>777</item>
> 
>           </one-of>
> 
>         </rule>
> 
>       </grammar>
> 
>       <prompt> second </prompt>
> 
>       <filled>
> 
>         <log> In filled of field2 </log>
> 
>       </filled>
> 
>     </field>
> 
>  
> 
>   </form>
> 
> </vxml>
> 
>  
> 
> *_Execution scenario1: During input collection of field2, provide input 
> matching menu level grammar._*
> 
>  
> 
> Prompt: Welcome to menu
> 
> Input: 0 (matches choice no:2 ) - leads to form2
> 
> Prompt: second
> 
> Input: 1 (matches choice no:3) - FIA jumps to menu and throws myEvent2
> 
> <log>: In generic event handler, event caught is myEvent2
> 
> ...Accessing formVar is menu scope leads to error.semantic
> 
> <log>: In error.semantic event handler
> 
> End of application
> 
>  
> 
> *_Execution scenario2: During input collection of field2, provide input 
> matching <grammar> which is a child of <choice>_*
> 
>  
> 
> Prompt: Welcome to menu
> 
> Input: 0 (matches choice no:2 ) - leads to form2
> 
> Prompt: second
> 
> Input: 5567 (matches digits?length=4 <grammar> child of choice no:1) - 
> FIA does not jump to menu. Throws myEvent1 in form scope
> 
> <log>: In generic event handler, event caught is myEvent1
> 
> <log>: In generic event handler, variable formVar is 100 
>                //No error.semantic here as formVar is accessible
> 
> End of application 
> 
>  
> 
>  
> 
> Is the behavior observed in execution scenario2 correct? Is it correct 
> for the interpreter to not jump to menu though the grammar which matched 
> is a child grammar of <choice>?
> 
>  
> 
> Thanks
> 
> Rajesh
> 
>  
> 
> This e-mail and attachments contain confidential information from 
> HUAWEI, which is intended only for the person or entity whose address is 
> listed above. Any use of the information contained herein in any way 
> (including, but not limited to, total or partial disclosure, 
> reproduction, or dissemination) by persons other than the intended 
> recipient's) is prohibited. If you receive this e-mail in error, please 
> notify the sender by phone or email immediately and delete it!
> 
> ------------------------------------------------------------------------
> 
> *From:* www-voice-request@w3.org <mailto:www-voice-request@w3.org> 
> [mailto:www-voice-request@w3.org] *On Behalf Of *Puneet Sharma
> *Sent:* Thursday, April 02, 2009 5:10 PM
> *To:* www-voice@w3.org <mailto:www-voice@w3.org>
> *Cc:* ranjit@hauwei.com <mailto:ranjit@hauwei.com>
> *Subject:* Matching a choice grammar
> 
>  
> 
> Hi,
> 
>  
> 
>   I feel there is an ambiguity in behavior of <choice> element.
> 
>  
> 
>   Consider case, where while recognition in a <form> , <menu 
> scope=”document”>’s  choice is matched. Then, I feel there is an 
> ambiguity about scope of current execution of <choice> element. 
> Specification does not clarify either it should be <menu> or <form>.
> 
>  
> 
>  
> 
> Please refer below section of Vxml 2.0  :
> 
> http://www.w3.org/TR/voicexml20/#dmlAFIA
> 
>  
> 
>            Appendix C — Form Interpretation Algorithm
> 
>     //
> 
>     // *Process Phase*: process the resulting utterance or event.
> 
>     //
> 
>  
> 
>     Assign the utterance and other information about the last
> 
>     recognition to application.lastresult$.
> 
>             // Must have an utterance
> 
>  
> 
>     if ( the utterance matched a grammar belonging to a <link> )
> 
>       If the link specifies an "next" or "expr" attribute,
> 
>       transition to that location.  Else if the link specifies an
> 
>       "event" or "eventexpr" attribute, generate that event.
> 
>  
> 
>     else if ( the utterance matched a grammar belonging to a <choice> )
> 
>       If the choice specifies an "next" or "expr" attribute,
> 
>       transition to that location.  Else if the choice specifies
> 
>       an "event" or "eventexpr" attribute, generate that event.
> 
>  
> 
>     else if ( the utterance matched a grammar from outside the current
> 
>               <form> or <menu> )
> 
>     {
> 
>       Transition to that <form> or <menu>, carrying the utterance
> 
>       to the new FIA.
> 
>     }
> 
>  
> 
>         >From this I understand that, if <choice> is matched from 
> outside of <menu> then execute <choice> without any transition to that 
> <menu>, so it is not clear that in which scope  event thrown by such 
> <choice> element should be handled.
> 
>           If it is <menu> then above specified algorithm does not allow 
> that because that grammar is from <choice>, and if it is <form>  then 
> <form> will be executing <filled> from some other scope which is not 
> right to do.
> 
>  
> 
>     Please also clarify below points also considering above scenarios:
> 
>    Specification:  A menu can be viewed as a form containing a single 
> field whose grammar and whose <filled> action are constructed from the 
> <choice> elements.
> 
>  
> 
>         This statement says that, <choice> is treated as <menu>/<form> 
> level grammar and  but <menu> can  specify scope attribute  which means 
> <choice> can be matched at global scope.   
> 
>  
> 
> Regards
> 
> Puneet

Received on Wednesday, 22 April 2009 07:41:20 UTC