我有以下语法,如果我删除该行,则<item>notepad++</item>
所有功能均按预期运行,但添加后,则无法识别任何内容。我正在处理Microsoft网站上的示例:链接
<?xml version="1.0" encoding="UTF-8" ?>
<grammar version="1.0" xml:lang="en-US" mode="voice" root="open"
xmlns="http://www.w3.org/2001/06/grammar" tag-format="semantics/1.0">
<rule id="open">
<item>open <ruleref uri="#progs"/></item>
</rule>
<rule id="progs">
<item>google <ruleref uri="#googleServices"/></item>
<item>notepad</item>
</rule>
<rule id="googleServices">
<one-of>
<item>inbox<tag>INBOX_URL</tag></item>
<item>drive<tag>DRIVE URL</tag></item>
<item>music<tag>MUSIC URL</tag></item>
</one-of>
</rule>
</grammar>
我的目标是说“打开记事本”或“打开Google收件箱”,并使语法响应。
根据该规范,您似乎需要one-of
指定仅一个item
应匹配:
<rule id="progs">
<one-of>
<item>google <ruleref uri="#googleServices"/></item>
<item>notepad</item>
</one-of>
</rule>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句