Ordinal Rules for English (United States)
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.
Ordinal rules recognize numeric ordering values that range from 1 (first) to 100 (one hundredth).
The numeric range that each rule recognizes is encoded in the rule name. For example, Ordinal_1_to_9 can recognize the ordinal expressions first through ninth.
The Ordinal rule covers the full range of values from first through one hundredth.
All Ordinal rules return a value of type integer.
Rules
Ordinal
Ordinal_1_to_9
Ordinal_1_to_31
Ordinal_10_to_19
Ordinal_20_to_29
Ordinal_20_to_99
Usage
<ruleref uri="Library.grxml#Ordinal" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Ordinal_1_to_9" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Ordinal_1_to_31" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Ordinal_10_to_19" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Ordinal_20_to_29" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Ordinal_20_to_99" type="application/srgs+xml"/>
The grammar can be used as follows (using the Ordinal rule as an example).
<grammar xmlns:sapi="http://schemas.microsoft.com/Speech/2002/06/SRGSExtensions"
xml:lang="en-US" 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#Ordinal" type="application/srgs+xml"/>
<tag>$ = $$</tag>
</rule>
</grammar>
JScript Objects
$Ordinal._value: integer [1...100]
$Ordinal_1_to_9._value: integer [1...9]
$Ordinal_1_to_31._value: integer [1...31]
$Ordinal_10_to_19._value: integer [10...19]
$Ordinal_20_to_29._value: integer [20...29]
$Ordinal_20_to_99._value: integer [20...99]
Examples: Ordinal
Example 1
User says: "First."
SML returned by the recognition engine.
<SML text="first" utteranceConfidence="1.000" confidence="1.000">1</SML>
Example 2
User says: "Thirty first."
SML returned by the recognition engine.
<SML text="thirty first" utteranceConfidence="1.000" confidence="1.000">31</SML>
Example 3
User says: "One hundredth."
SML returned by the recognition engine.
<SML text="one hundredth" utteranceConfidence="1.000" confidence="1.000">100</SML>