Share via


Phone Number Rules for Spanish (United States)

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 U.S. phone numbers spoken in Spanish (United States).

The PhoneNumber_US_AreaCode rule recognizes a three-digit number. The PhoneNumber_US_LocalNumber rule recognizes a seven-digit number.

The PhoneNumber_US_AreaCode and PhoneNumber_US_LocalNumber rules support common digit groupings. For example, the PhoneNumber_US_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: "uno dos tres doce treinta y cuatro."

All Spanish (United States) phone number rules return a value of type string.

Rules

PhoneNumber_US_AreaCode

PhoneNumber_US_LocalNumber

Usage

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

The grammar can be used as follows (using the PhoneNumber_US_LocalNumber rule as an example).

<grammar xmlns:sapi="http://schemas.microsoft.com/Speech/2002/06/SRGSExtensions"
         xml:lang="es-US" 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_US_LocalNumber" type="application/srgs+xml"/>
    <tag>$ = $$</tag>
    </rule>
</grammar>

JScript Objects

$PhoneNumber_US_AreaCode._value: string [3 characters]
$PhoneNumber_US_LocalNumber._value: string [7 characters]

Example: PhoneNumber_US_AreaCode

Example 1

User says: "cuatro dos cinco."

SML returned by the recognition engine.

<SML text="cuatro dos cinco" utteranceConfidence="1.000" confidence="1.000">425</SML>

Example: PhoneNumber_US_LocalNumber

Example 1

User says: "cuatro dos cinco."

SML returned by the recognition engine.

<SML text="cuatro dos cinco" utteranceConfidence="1.000" confidence="1.000">5552345</SML>

Example 2

User says: "dos tres cuatro quince diecis??is."

SML returned by the recognition engine.

<SML text="dos tres cuatro quince diecis??is" utteranceConfidence="1.000" confidence="1.000">2341516</SML>

See Also

Concepts

Voice Mode Grammar Library for Spanish (United States)