Alphanum Rule for French (Canada)
Retrieves any combination of up to 10 single digits and characters. The number of digits, characters, or a combination of digits and characters that can be retrieved is stated by the rule. Grouping is the ability of the Alphanum module to retrieve a group of digits. For example, the Digit4 rule retrieves "1234" when a user says douze trente-quatre.
Rules
Rule Name | Description |
---|---|
Digit1 | Retrieves 1 digit. |
Digitn | Retrieves n digits, where n can be 2–10, inclusive. Grouping allowed. |
SimpleDigit1 | Retrieves 1 digit. |
SimpleDigitn | Retrieves n digits, where n can be 2–10, inclusive. No grouping allowed. |
Alphanum1 | Retrieves 1 digit or character. |
Alphanumn | Retrieves n digits, characters, or a combination of digits and characters, where n can be 2–10, inclusive. Digit grouping allowed. |
SimpleAlphanum1 | Retrieves 1 digit and/or character. |
SimpleAlphanumn | Retrieves n digits, characters, or a combination of digits and characters, where n can be 2–10, inclusive. No digit grouping allowed. |
Usage
<!-- using the SimpleAlphanum3 rule as an example -->
<ruleref uri="cmnrules.cfg#SimpleAlphanum3" />
The grammar can be used as follows (using the SimpleAlphanum4 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#SimpleAlphanum4" />
<tag>$ = $$</tag>
</rule>
</grammar>
JScript Object
$[Rulename]._value : string //Where x is the number of digits for the rule
Examples: Digit4 rule
Example 1
User says: un deux trois quatre.
SML returned by the recognition engine:
<SML confidence="1.000" text="un deux trois quatre" utteranceConfidence="1.000">1234</SML>
Example 2
User says: douze trente-quatre. The result is the same as shown in Example 1 previously. Digit grouping allowed.
SML returned by the recognition engine:
<SML confidence="1.000" text="douze trente-quatre" utteranceConfidence="1.000">1234</SML>
Example 3
User says: huit mille.
SML returned by the recognition engine:
<SML confidence="1.000" text="huit mille" utteranceConfidence="1.000">8000</SML>
Example 4
User says: deux un zéro zéro.
SML returned by the recognition engine:
<SML confidence="1.000" text="deux un zéro zéro" utteranceConfidence="1.000">2100</SML>
Examples: Alphanum4 rule
Example 1
User says: deux un zéro zéro.
SML returned by the recognition engine:
<SML confidence="1.000" text="deux un zéro zéro" utteranceConfidence="1.000">2100</SML>
Example 2
User says: a zéro zéro b.
SML returned by the recognition engine:
<SML confidence="1.000" text="a. zéro zéro b." utteranceConfidence="1.000">A00B</SML>
Note When the speech recognition engine recognizes letters of the alphabet that are spoken as individual letters, the resulting SML expresses those letters as initials. When validating recognition strings containing individual letters using Speech Grammar Editor, or when using the Speech Debugging Console to emulate SML for strings containing individual letters, enter the letter followed by a period to indicate that the letter is being used individually, and not in the context of a word. For example, to validate the previous example using Speech Grammar Editor, type a zéro zéro b in the Recognition string text box and click Check.
Example 3
User says: i cinq vingt. Digit grouping allowed.
SML returned by the recognition engine:
<SML confidence="1.000" text="i. cinq vingt" utteranceConfidence="1.000">I520</SML>