Numeral Rule for French (Canada)
Retrieves a number of a specified class. The class of the number is specified by the rule which is being activated. The following classes of numbers can be retrieved:
- Natural
- Integer
- Floating-point
- Fraction
- Cardinal
- Ordinal
Rules
Rule Name | Description |
---|---|
natural_number | A whole, non-negative integer (including zero). |
integer | A whole number that can be positive, negative, or zero. |
floating_point | A number that must contain a decimal point followed by at least one digit. |
fraction | A numerical representation indicating the quotient of two numbers. |
number | A generic rule that accepts all numbers, including integers, floating-point numbers, and fractions. |
Usage
<!-- using the natural_number rule as an example -->
<ruleref uri="cmnrules.cfg#natural_number"/>
The grammar can be used as follows:
<!-- using the natural_number rule as an example -->
<grammar version="1.0" mode="voice" root="Rule1" tag-format="semantics-ms/1.0"
xml:lang="fr-CA" xmlns="http://www.w3.org/2001/06/grammar"
xmlns:sapi="https://schemas.microsoft.com/Speech/2002/06/SRGSExtensions">
<rule id="Rule1">
<ruleref uri="cmnrules.cfg#natural_number"/>
<tag>$ = $$</tag>
</rule>
</grammar>
JScript Object
$natural_number_value : integer
Examples: natural_number
Example 1
User says: zéro.
SML returned by the recognition engine:
<SML confidence="1.000" text="zéro" utteranceConfidence="1.000">0</SML>
Example 2
User says: deux mille cinq cents.
SML returned by the recognition engine:
<SML confidence="1.000" text="deux mille cinq cents" utteranceConfidence="1.000">2500</SML>
Example 3
User says: un milliard trois millions quatre cents.
SML returned by the recognition engine:
<SML confidence="1.000" text="un milliard trois millions quatre cents" utteranceConfidence="1.000">1003000400</SML>
Example 4
User says: cinq mille trois cent cinq.
SML returned by the recognition engine:
<SML confidence="1.000" text="cinq mille trois cent cinq" utteranceConfidence="1.000">5305</SML>
Examples: integer
Example 1
User says: cinq mille trois cent cinq.
SML returned by the recognition engine:
<SML confidence="1.000" text="cinq mille trois cent cinq" utteranceConfidence="1.000">5305</SML>
Example 2
User says: moins cinq mille trois cent cinq.
SML returned by the recognition engine:
<SML confidence="1.000" text="moins cinq mille trois cent cinq" utteranceConfidence="1.000">-5305</SML>
Examples: fraction
Example 1
User says: sept seizièmes.
SML returned by the recognition engine:
<SML confidence="1.000" text="sept seizièmes" utteranceConfidence="1.000">0.4375</SML>
Example 2
User says: un et deux tiers.
SML returned by the recognition engine:
<SML confidence="1.000" text="un et deux tiers" utteranceConfidence="1.000">1.66666666666667</SML>
Example 3
User says: trois quarts.
SML returned by the recognition engine:
<SML confidence="1.000" text="trois quarts" utteranceConfidence="1.000">0.75</SML>
Example: number
Example 1
User says: deux point trois million.
SML returned by the recognition engine:
<SML confidence="1.000" text="deux point trois million" utteranceConfidence="1.000">2300000</SML>