Share via


Ordinal Rules for Spanish (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 (primero/primer/primera) to 100 (cent??simo/cent??sima).

The numeric range that each rule recognizes is encoded in the rule name. For example, Ordinal_1_to_9 can recognize the ordinal expressions "primero" through "noveno."

The Ordinal rule covers the full range of values from "primero" to "cent??simo."

All Ordinal rules contain both masculine and feminine forms and return a value of type integer.

Rules

Ordinal

Ordinal_1_to_9

Ordinal_10_to_19

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_10_to_19" 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="es-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_10_to_19._value: integer [10...19]
$Ordinal_20_to_99._value: integer [20...99]

Examples: Ordinal

Example 1

User says: "Primera."

SML returned by the recognition engine.

<SML text="primera" utteranceConfidence="1.000" confidence="1.000">1</SML>

Example 2

User says: "Trig??sima primera."

SML returned by the recognition engine.

<SML text="trig??sima primera" utteranceConfidence="1.000" confidence="1.000">31</SML>

Example 3

User says: "Cent??simo."

SML returned by the recognition engine.

<SML text="cent??simo" utteranceConfidence="1.000" confidence="1.000">100</SML>

See Also

Concepts

Voice Mode Grammar Library for Spanish (United States)