Partilhar via


USPhoneNumber Rule for French (Canada)

  Microsoft Speech Technologies Homepage

Retrieves a seven digit local telephone number with optional area code and one to five digit extensions. USPhoneNumber is composed of the following elements:

  • LocalNumber
  • AreaCode
  • Extension

A telephone number that is spoken as 11 digits with 1 as the first digit, is returned as a 10 digit telephone number (area code and local number). The prefix before the area code is not returned. A telephone number that is spoken as 11 digits must begin with a 1 or a noreco is returned. Eleven digit telephone numbers that begin with 9 are returned without the 9.

An extension is triggered and returned if a user indicates an extension following 7, 10, or 11 digits.

Digit groupings are supported. Grouping is the ability of the AlphaNum rule to retrieve a group of digits. For example, the Digit4 rule retrieves "1234" when a user says douze trente-quatre.

911 is supported.

Rule

USPhoneNumber

Usage

<ruleref uri="cmnrules.cfg#USPhoneNumber"/>

The grammar can be used as follows:

<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#USPhoneNumber"/>
    <tag>$ = $$</tag>
    </rule>
</grammar>

JScript Object

$USPhoneNumber.AreaCode._value : string (optional)
$USPhoneNumber.LocalNumber._value : string
$USPhoneNumber.Extension._value : string (optional)
$USPhoneNumber.X11._value : string

Examples: USPhoneNumber

Example 1

User says: cinq cinq cinq zéro un zéro zéro.

The utterance is treated as a local telephone number. Area code is not returned.

SML returned by the recognition engine:

<SML confidence="1.000" text="cinq cinq cinq zéro un zéro zéro" utteranceConfidence="1.000">
   <LocalNumber confidence="1.000" text="cinq cinq cinq zéro un zéro zéro">5550100</LocalNumber> 
</SML>

Example 2

User says: cinq cinq cinq zéro cent.

The utterance is treated as a local telephone number. Area code is not returned. Digit grouping is illustrated.

SML returned by the recognition engine:

<SML confidence="1.000" text="cinq cinq cinq zéro cent" utteranceConfidence="1.000">
   <LocalNumber confidence="1.000" text="cinq cinq cinq zéro cent">5550100</LocalNumber> 
</SML>

Example 3

User says: cinq cinq cinq mille.

The utterance is treated as a local telephone number. Area code is not returned. Digit grouping is illustrated.

SML returned by the recognition engine:

<SML confidence="1.000" text="cinq cinq cinq mille" utteranceConfidence="1.000">
   <LocalNumber confidence="1.000" text="cinq cinq cinq mille">5551000</LocalNumber> 
</SML>

Example 4

User says: un deux zéro six cinq cinq cinq zéro un zéro zéro.

The prefix before the area code is not returned. Area code and local number are returned.

SML returned by the recognition engine:

<SML confidence="1.000" text="un deux zéro six cinq cinq cinq zéro un zéro zéro" utteranceConfidence="1.000">
   <AreaCode confidence="1.000" text="deux zéro six">206</AreaCode> 
   <LocalNumber confidence="1.000" text="cinq cinq cinq zéro un zéro zéro">5550100</LocalNumber> 
</SML>

Example 5

User says: deux zéro six cinq cinq cinq zéro un zéro zéro.

Area code and local number are returned.

SML returned by the recognition engine:

<SML confidence="1.000" text="deux zéro six cinq cinq cinq zéro un zéro zéro" utteranceConfidence="1.000">
   <AreaCode confidence="1.000" text="deux zéro six">206</AreaCode> 
   <LocalNumber confidence="1.000" text="cinq cinq cinq zéro un zéro zéro">5550100</LocalNumber> 
</SML>

Example 6

User says: un huit cents cinq cinq cinq zéro un zéro zéro.

The prefix before the area code is not returned. Area code and local number are returned.

SML returned by the recognition engine:

<SML confidence="1.000" text="un huit cents cinq cinq cinq zéro un zéro zéro" utteranceConfidence="1.000">
   <AreaCode confidence="1.000" text="huit cents">800</AreaCode> 
   <LocalNumber confidence="1.000" text="cinq cinq cinq zéro un zéro zéro">5550100</LocalNumber> 
</SML>

Example 7

User says: cinq cinq cinq zéro un zéro zéro poste un deux trois.

The utterance of the word "extension" after 7 digits causes an Extension to be returned. Area code and local number are returned.

SML returned by the recognition engine:

<SML confidence="1.000" text="cinq cinq cinq zéro un zéro zéro poste un deux trois" utteranceConfidence="1.000">
   <LocalNumber confidence="1.000" text="cinq cinq cinq zéro un zéro zéro">5550100</LocalNumber> 
   <Extension confidence="1.000" text="un deux trois">123</Extension> 
</SML>

Example 8

User says: cinq cinq cinq zéro un zéro zéro extension douze zéro zéro.

The utterance of the word "extension" after 7 digits causes an Extension to be returned. Area code and local number are returned.

SML returned by the recognition engine:

<SML confidence="1.000" text="cinq cinq cinq zéro un zéro zéro extension douze zéro zéro" utteranceConfidence="1.000">
   <LocalNumber confidence="1.000" text="cinq cinq cinq zéro un zéro zéro">5550100</LocalNumber> 
   <Extension confidence="1.000" text="douze zéro zéro">1200</Extension> 
</SML>

Example 9

User says: neuf un un.

SML returned by the recognition engine:

<SML confidence="1.000" text="neuf un un" utteranceConfidence="1.000">
   <X11 confidence="1.000" text="neuf un un">911</X11> 
</SML>

See Also

Voice Mode Grammar Library | DTMF Mode Grammar Library