DigitBlock Rules for English (United Kingdom)
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
DigitBlock rules describe sequences of digit strings in length from 2 to 4 digits. For example "two zero" (20), "two three five four" (2354), or "twenty three fifty four" (2354).
The length of the DigitBlock is encoded in the rule name. For example, DigitBlock_2Digits recognizes strings of digits that are two digits in length.
All DigitBlock rules return a value of type string.
Rules
DigitBlock_2Digits
DigitBlock_3Digits
DigitBlock_4Digits
Usage
<ruleref uri="Library.grxml#DigitBlock_2Digits" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#DigitBlock_3Digits" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#DigitBlock_4Digits" type="application/srgs+xml"/>
The grammar can be used as follows (using the DigitBlock_3Digits rule as an example).
<grammar xmlns:sapi="http://schemas.microsoft.com/Speech/2002/06/SRGSExtensions"
xml:lang="en-GB" tag-format="semantics-ms/1.0" version="1.0" mode="voice"
root="Rule1" xmlns="http://www.w3.org/2001/06/grammar">
<rule id="Rule1" scope="public">
<ruleref uri="Library.grxml#DigitBlock_3Digits" type="application/srgs+xml"/>
<tag>$ = $$</tag>
</rule>
</grammar>
JScript Objects
$DigitBlock_2Digits._value: string [length 2]
$DigitBlock_3Digits._value: string [length 3]
$DigitBlock_4Digits._value: string [length 4]
Example: DigitBlock_2Digits
Example 1
User says: "One two."
SML returned by the recognition engine.
<SML text="one two" utteranceConfidence="1.000" confidence="1.000">12</SML>
Example: DigitBlock_3Digits
Example 1
User says: "Two four six."
SML returned by the recognition engine.
<SML text="two four six" utteranceConfidence="1.000" confidence="1.000">246</SML>
Examples: DigitBlock_4Digits
Example 1
User says: "Eight nine oh oh."
SML returned by the recognition engine.
<SML text="eight nine oh oh" utteranceConfidence="1.000" confidence="1.000">8900</SML>
Example 2
User says: "Twelve thirty four."
SML returned by the recognition engine.
<SML text="twelve thirty four" utteranceConfidence="1.000" confidence="1.000">1234</SML>