语音识别语法不适用于多个项目

里尔孔42

我有以下语法,如果我删除该行,则<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>  

我的目标是说“打开记事本”或“打开Goog​​le收件箱”,并使语法响应。

阿列克谢·列文科夫(Alexei Levenkov)

根据该规范,您似乎需要one-of指定仅一个item应匹配:

<rule id="progs">
  <one-of>
    <item>google <ruleref uri="#googleServices"/></item>
    <item>notepad</item>
  </one-of>
</rule>

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章