voicexml输出外部语法并重新填充field元素
我希望,如果用户说“帮助”,则以下字段不会被填充,并且用户会获得所有可能的选项。
<form id="test">
<field name="var1">
<prompt bargein="true" bargeintype="hotword" >say xy </prompt>
<grammar src = "grammar.grxml" type="application/srgs+xml" />
<filled>
<assign name="myProdukt" expr="var1" />
you said <value expr="myProdukt"/>
</filled>
</field>
(假设外部语法是“p1”、“p2”和“p3”,用户说“help”,系统说“p1”、“p2”、“p3”,用户可以再次选择 - 因此“帮助”一词也必须出现在外部语法中,不是吗?)
提前致谢
I would like, that if the user says "help" that the following field doesn't get filled, and that the user gets all possible options.
<form id="test">
<field name="var1">
<prompt bargein="true" bargeintype="hotword" >say xy </prompt>
<grammar src = "grammar.grxml" type="application/srgs+xml" />
<filled>
<assign name="myProdukt" expr="var1" />
you said <value expr="myProdukt"/>
</filled>
</field>
(let's say in the external grammar is "p1", "p2" and "p3", the user says "help", and the systems says "p1","p2","p3" and the user can choose again - therefore the word "help" has to be in the external grammar as well, doesn't it?)
thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,活动语法必须包含返回值“help”的“help”话语。然后,您可以使用
help
标记捕获该事件:或者,按照 DRY 原则,可以使用包含
链接应用程序根文档为您的应用程序全局实现此效果> 元素。在下面的示例
app-root.vxml
文档中,有一个链接
将全局语法“help”话语绑定到help
事件:语法将在任何地方都是活跃的——有效地与每个活跃的领域语法合并。如果您需要有关应用程序根文档的更多信息,请参阅 VoiceXML 规范执行部分多文档应用程序解释了这一点。另请参阅 Tellme 中的处理事件 Studio 文档
然后,在应用程序的页面中,通过
vxml
元素的application
属性引用应用程序根文档,并在>help
catch 块:当然,您可以将
link
代码与表单放在同一页面中,但您可能希望help
处于活动状态适用于应用程序的每个领域,除非与特定领域的语法中的某些内容发生冲突。Yes, the active grammar must contain a "help" utterance which returns the value 'help'. You then catch the event with a
help
tag:Alternatively, following the DRY principle, this effect can be done globally for your application with using an application root document containing a
link
element. In the exampleapp-root.vxml
document below, there is alink
binding a global grammar "help" utterance to thehelp
event :This grammar will be active everywhere -- effectively merged with each active field grammar. If you need more information about application root documents, the section of the VoiceXML specification Executing a Multi-Document Application explains. Also see Handling Events from the Tellme Studio documentation
Then, in pages of your application, make reference to the application root document via the
application
attribute of thevxml
element and speak appropriately in ahelp
catch block:You could, of course, put the
link
code in the same page as your form, but it is likely you will wanthelp
active for every field of your application unless there is collision with something in a particular field's grammar.