我有以下XML语法检测像1000或2200等解释
<rule id="rule1" scope="public">
<one-of>
<item>1</item>
<item>2</item>
<item>3</item>
</one-of>
<ruleref uri="#rule2"/>
</rule>
<rule id="rule2" scope="public">
<one-of>
<item>thousand<tag>out="000";</tag></item>
<item>thousand 100<tag>out=100;</tag></item>
<item>thousand 200<tag>out=200;</tag></item>
</one-of>
</rule>
一批然而,当用户说,例如2100年,我获得“2000 100”,而不是2100年。似乎out =部分不起作用。我在网上看到了几个例子,不知道是否还有其他东西需要添加来完成这项工作。我正在使用tag-format =“semantics/1.0”
这取决于你正在使用的引擎,不是吗?它可能不支持标签。你正在使用哪一个?同样为了完整性,我会在第二和第三种情况下添加引号。 –
我在C#中使用SpeechRecognitionEngine来加载语法。我已经尝试过,没有引号。 – kr13