Share via


Cardinal 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.

Cardinal rules recognize numeric values ranging from "0" to "1,000,000."

The numeric range that each rule recognizes is encoded in the rule name. For example, Cardinal_1_to_9 can recognize the numbers in the range of one to nine.

The Cardinal rule recognizes the full range of values from "cero" to "un Mill??n".

All Cardinal rules return a value of type integer.

The voice mode grammar library contains two additional rules for recognizing cardinal numbers. The Number rule recognizes values from -1,000,000.00 to 1,000,000.00 and the Number_upto1000 rule recognizes values from -1000.00 to 1,000.00.

The Number rules return a value of type float.

Rules

Cardinal

Cardinal_0

Cardinal_0_to_9

Cardinal_0_to_10

Cardinal_0_to_100

Cardinal_0_to_1000

Cardinal_0_to_10000

Cardinal_1_to_9

Cardinal_1_to_99

Cardinal_2_to_99

Cardinal_1_to_999

Cardinal_2_to_999

Cardinal_1_to_9999

Cardinal_2_to_9

Cardinal_10_to_19

Cardinal_10_to_99

Cardinal_20_to_99

Cardinal_100_to_999

Cardinal_1000_to_999999

Number

Number_upto1000

Usage

<ruleref uri="Library.grxml#Cardinal" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_0" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_0_to_9" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_0_to_10" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_0_to_100" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_0_to_1000" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_0_to_10000" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_1_to_9" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_1_to_99" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_2_to_99" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_1_to_999" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_2_to_999" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_1_to_9999" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_2_to_9" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_10_to_19" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_10_to_99" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_20_to_99" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_100_to_999" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_1000_to_999999" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Number" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Number_upto1000" type="application/srgs+xml"/>

The grammar can be used as follows (using the Cardinal 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#Cardinal" type="application/srgs+xml"/>
    <tag>$ = $$</tag>
    </rule>
</grammar>

JScript Objects

$Cardinal._value: integer [0...1,000,000]
$Cardinal_0._value: integer [0]
$Cardinal_0_to_9._value: integer [0...9]
$Cardinal_0_to_10._value: integer [0...10]
$Cardinal_0_to_100._value: integer [0...100]
$Cardinal_0_to_1000._value: integer [0...1000]
$Cardinal_0_to_1000._value: integer [0...10000]
$Cardinal_1_to_9._value: integer [1...9]
$Cardinal_1_to_99._value: integer [1...99]
$Cardinal_2_to_9._value: integer [2...99]
$Cardinal_1_to_999._value: integer [1...999]
$Cardinal_2_to_9._value: integer [2...999]
$Cardinal_1_to_999._value: integer [1...9999]
$Cardinal_2_to_9._value: integer [2...9]
$Cardinal_10_to_19._value: integer [10...19]
$Cardinal_10_to_99._value: integer [10...99]
$Cardinal_20_to_99._value: integer [20...99]
$Cardinal_100_to_999._value: integer [100...999]
$Cardinal_1000_to_999999._value: integer [1000...999999]
$Number._value: float [-1000000.00...1000000.00]
$Number_upto1000._value: float [-1000000.00...1000000.00]

Examples: Cardinal

Example 1

User says: "ciento cincuenta."

SML returned by the recognition engine.

<SML text="ciento cincuenta" utteranceConfidence="1.000" confidence="1.000">150</SML>

Example 2

User says: "cincuenta miles seis cientos cuatro."

SML returned by the recognition engine.

<SML text="cincuenta miles seis cientos cuatro" utteranceConfidence="1.000" confidence="1.000">50604</SML>

Example 3

User says: "siete cientos sesenta y cinco mil cuatro cientos treinta y dos."

SML returned by the recognition engine.

<SML text="siete cientos sesenta y cinco mil cuatro cientos treinta y dos" utteranceConfidence="1.000" confidence="1.000">765432</SML>

See Also

Concepts

Voice Mode Grammar Library for Spanish (United States)