我有以下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