android - AT&T XML speech recognition -
i have recognize alternative rules, don't know how mutual exclusion. example, if want recognize "play", "stop", or "set 1", "set 2", how can do? tried this, doesn't recognize when don't need number (for example, "start 2" correctly recognized, trivially don't want to).
<grammar version="1.0" tag-format="semantics/1.0" xml:lang="en-us" root="main"> <rule id="main"> <ruleref uri="#actions"/> <ruleref uri="#numbers"/> </rule> <rule id="actions"> <item repeat="0-1"> <one-of> <item>play</item> <item>stop</item> <item>set</item> </one-of> </item> </rule> <rule id="numbers"> <item repeat="0-1"> <one-of> <item>1</item> <item>2</item> <item>3</item> <item>4</item> <item>5</item> <item>6</item> <item>7</item> <item>8</item> <item>9</item> </one-of> </item> </rule> </grammar>
simply found out if put
<item>play <ruleref special="garbage"/></item> <item>stop <ruleref special="garbage"/></item> <item>set <ruleref special="garbage"/><ruleref uri="#numbers"/></item>
calling id reference after set take "set 1", "set 2", doesn't accept "start 1" because there isn't reference after name.
Comments
Post a Comment