Partager via


Phone Number 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.

The grammar library provides two rules for recognizing Canadian phone numbers spoken in French (Canada).

The PhoneNumber_FRC_AreaCode rule recognizes a three-digit number. The PhoneNumber_FRC_LocalNumber rule recognizes a seven-digit number.

The PhoneNumber_FRC_AreaCode and PhoneNumber_FRC_LocalNumber rules support common digit groupings. For example, the PhoneNumber_FRC_LocalNumber rule can recognize the expression of the seven-digit phone number 123 1234 as the following series of three single digits followed by two, two-digit groupings: "un deux trois douze trente-quatre."

All French (Canada) phone number rules return a value of type string.

Rules

PhoneNumber_FRC_AreaCode

PhoneNumber_FRC_LocalNumber

Usage

<ruleref uri="Library.grxml#PhoneNumber_FRC_AreaCode" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#PhoneNumber_FRC_LocalNumber" type="application/srgs+xml"/>

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

JScript Objects

$PhoneNumber_FRC_AreaCode._value: string [3 characters]
$PhoneNumber_FRC_LocalNumber._value: string [7 characters]

Example: PhoneNumber_FRC_AreaCode

Example 1

User says: "un un un."

SML returned by the recognition engine.

<SML text="un un un" utteranceConfidence="1.000" confidence="1.000">111</SML>

Example: PhoneNumber_FRC_LocalNumber

Example 1

User says: "un deux trois z??ro neuf huit sept."

SML returned by the recognition engine.

<SML text="un deux trois z??ro neuf huit sept" utteranceConfidence="1.000" confidence="1.000">1230987</SML>

Example 2

User says: "un deux trois quatorze quinze."

SML returned by the recognition engine.

<SML text="un deux trois quatorze quinze" utteranceConfidence="1.000" confidence="1.000">1231415</SML>

See Also

Concepts

Voice Mode Grammar Library for French (Canada)