I have got the following XML grammar to detect a number like 1000 or 2200 etc.
<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>
However when the user says for example 2100, I get "2 thousand 100" instead of 2100. It seems like the out= part is not working. I have seen several examples online and don't know if there is something else I need to add to make this work. I am using tag-format="semantics/1.0"
The way I solved this was to use just one rule and use properties like out.start, out.end and then concatenate them.
To retrieve the semantic value from C# you can use something like
The Microsoft Speech SDK comes with a sample SRGS that can handle numbers quite well. For instance the "Cardinal" rule can handle numbers up to 1,000,000. It's available in a variety of languages in the Samples directory (e.g. C:\Program Files\Microsoft SDKs\Speech\v11.0\Samples\Sample Grammars\en-US.grxml).