I am building a GRXML grammar for a software that will use Microsoft's Speech SDK for voice recognition.
The tags must follow the tag-format "properties-ms/1.0" about which I did not find any specific documentation (apart from MSDN that does not answer my question).
My main concern is about tagging digits so as to transform a recognized text like "one two three four" into the number "1234". Here is the idea :
<rule id="CODE">
<item repeat="4">
<ruleref uri="#DIGIT"/>
</item>
</rule>
<rule id="DIGIT">
<one-of>
<item>
one
<tag>"1"</tag>
</item>
<item>
two
<tag>"2"</tag>
</item>
<item>
three
<tag>"3"</tag>
</item>
<item>
four
<tag>"4"</tag>
</item>
<item>
five
<tag>"5"</tag>
</item>
</one-of>
</rule>
This does no concatenation but at least I get the semantic value for each digit.
However when I use such a rule for the digits, at runtime the program breaks, throwing an exception stating "The semantic value in rule 'CODE' was already set and cannot be changed.".
How can I make the semantic tagging work along with the "repeat" of the DIGIT rule ? I do not wish to split my CODE rule into 4 identical items, each with a different semantic key : there are other cases in my grammar where the number of digits is not fixed.
Also, is there a way to concatenate the tags so as to provide a general semantic meaning for the number .