Partager via


Cardinal Rules for French (Canada)

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 recognizes the numbers in the range of 1 to 9.

The Cardinal rule recognizes the full range of values from "z??ro" to "un million."

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_1_to_999

Cardinal_1_to_9999

Cardinal_2_to_9

Cardinal_2_to_31

Cardinal_2_to_999

Cardinal_10_to_19

Cardinal_10_to_99

Cardinal_12_to_19

Cardinal_20_to_29

Cardinal_20_to_99

Cardinal_30_to_39

Cardinal_40_to_49

Cardinal_50_to_59

Cardinal_60_to_69

Cardinal_70_to_79

Cardinal_80_to_89

Cardinal_90_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_1_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_2_to_31" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_2_to_999" 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_12_to_19" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_20_to_29" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_20_to_99" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_30_to_39" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_40_to_49" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_50_to_59" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_60_to_69" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_70_to_79" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_80_to_89" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Cardinal_90_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="fr-CA" 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_1_to_999._value: integer [1...999]
$Cardinal_1_to_999._value: integer [1...9999]
$Cardinal_2_to_9._value: integer [2...9]
$Cardinal_2_to_9._value: integer [2...31]
$Cardinal_2_to_9._value: integer [2...999]
$Cardinal_10_to_19._value: integer [10...19]
$Cardinal_10_to_99._value: integer [10...99]
$Cardinal_10_to_19._value: integer [12...19]
$Cardinal_20_to_29._value: integer [20...29]
$Cardinal_20_to_99._value: integer [20...99]
$Cardinal_20_to_99._value: integer [30...39]
$Cardinal_20_to_99._value: integer [40...49]
$Cardinal_20_to_99._value: integer [50...59]
$Cardinal_20_to_99._value: integer [60...69]
$Cardinal_20_to_99._value: integer [70...79]
$Cardinal_20_to_99._value: integer [80...89]
$Cardinal_20_to_99._value: integer [90...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: "cent cinquante."

SML returned by the recognition engine.

<SML text="cent cinquante" utteranceConfidence="1.000" confidence="1.000">150</SML>

Example 2

User says: "cinquante mille six cent quatre."

SML returned by the recognition engine.

<SML text="cinquante mille six cent quatre" utteranceConfidence="1.000" confidence="1.000">50604</SML>

Example 3

User says: "sept cent soixante-cinq mille quatre cent trente-deux."

SML returned by the recognition engine.

<SML text="sept cent soixante-cinq mille quatre cent trente-deux" utteranceConfidence="1.000" confidence="1.000">765432</SML>

See Also

Concepts

Voice Mode Grammar Library for French (Canada)