Freigeben über


CreditCard Rule for Spanish (United States)

  Microsoft Speech Technologies Homepage

Retrieves the credit card number and credit card expiration date for the following credit cards:

  • Visa
  • Mastercard
  • American Express
  • Diner's Club
  • Discover

An application can support recognition of any of the five card types in this list, or support recognition of only an individual card. Select the appropriate rule from the following list of valid rules:

  • CreditCardNumber
  • VisaCardNumber
  • MasterCardNumber
  • AmexCardNumber
  • DiscoverCardNumber
  • DinersClubCardNumber

Credit Card Number

Contains built-in validation routines to detect invalid credit card numbers. Invalid credit card numbers probably arise from digit transposition by the speaker or from recognition errors. Invalid credit card numbers are flagged in the returned results with the inclusion of the InvalidCardNumber tag.

The validation routines do not perform purchase authorization.

All examples in this document contain invalid credit card numbers for security reasons. If the sample credit card numbers were valid, the InvalidCardNumber tag would not exist in the returned SML.

Usage

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

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

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

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

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

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

The CreditCardNumber rule retrieves credit card numbers for all five supported card types.

The grammar can be used as (for example, the rule for Visa card):

<grammar version="1.0" mode="voice" root="Rule1" tag-format="semantics-ms/1.0" 
  xml:lang="es-US" 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#VisaCardNumber" />
    <tag>$ = $$</tag>
    </rule>
</grammar>

JScript Objects

$[CreditCardRuleName]._attributes.name: string
$[CreditCardRuleName]._value: string
$[CreditCardRuleName].InvalidCardNumber: empty node (optional)

Examples: CreditCardNumber

Example 1

The CreditCardNumber rule is active.

User says: (the credit card number) cuatro uno dos cero uno uno uno uno cero cero uno dos seis uno dos cinco

Semantic Markup Language (SML) returned by the recognition engine:

<SML confidence="1.000" luhnValidation="false" name="Visa" text="cuatro uno dos cero uno uno uno uno cero cero uno dos seis uno dos cinco" utteranceConfidence="1.000">
    4120111100126125
</SML>

The name attribute of the returned SML provides the credit card type.

Example 2

The VisaCardNumber rule is active.

User says: cuatro uno dos cero uno uno uno uno cero cero uno dos seis uno dos cinco

SML returned by the recognition engine:

<SML confidence="1.000" luhnValidation="false" name="Visa" text="cuatro uno dos cero uno uno uno uno cero cero uno dos seis uno dos cinco" utteranceConfidence="1.000">
    4120111100126125  
</SML>

This is the same result as shown in Example 1 previously. The name attribute of the returned SML provides the credit card type.

Example 3

The MasterCardNumber rule is active.

User says: cincuenta y uno veinte y cuatro veinte y cuatro sesenta y dos uno nueve cero cinco dos tres uno uno

SML returned by the recognition engine:

<SML confidence="1.000" luhnValidation="false" name="Master" text="cincuenta y uno veinte y cuatro veinte y cuatro sesenta y dos uno nueve cero cinco dos tres uno uno" utteranceConfidence="1.000">
    5124246219052311 
</SML>

Digit grouping is allowed. 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 doce treinta y cuatro.

Credit Card Expiration Date

This rule recognizes a single utterance containing a month and year, and returns separate nodes for the month and year in the SML output. The grammar does not validate the date to ensure that it is in the future. Use the ClientValidationFunction Property of the CustomValidator Class to validate the date.

Usage

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

The grammar can be used as follows:

<grammar version="1.0" mode="voice" root="Rule1" tag-format="semantics-ms/1.0" 
  xml:lang="es-US" 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#CreditCardExpirationDate" />
    <tag>$ = $$</tag>
    </rule>
</grammar>

Examples: CreditCardExpirationDate

Example 1

User says: cero cinco cero cinco.

SML returned by the recognition engine:

<SML confidence="1.000" text="cero cinco cero cinco" utteranceConfidence="1.000">
    <Month confidence="1.000" text="cero cinco">5</Month>
    <Year confidence="1.000" text="cero cinco">2005</Year> 
</SML>

Example 2

User says: mayo del año que viene. Assume that the current month is February, 2002.

SML returned by the recognition engine:

<SML confidence="1.000" text="mayo del año que viene" utteranceConfidence="1.000">
    <Month confidence="1.000" text="mayo">5</Month> 
    <Year confidence="1.000" text="del año que viene">2003</Year> 
</SML>

Example 3

User says: junio cero cuatro.

SML returned by the recognition engine:

<SML confidence="1.000" text="junio cero cuatro" utteranceConfidence="1.000">
    <Month confidence="1.000" text="junio">6</Month> 
    <Year confidence="1.000" text="cero cuatro">2004</Year> 
</SML>

Example 4

User says: el mes próximo. Assume that the current month is August, 2002.

SML returned by the recognition engine:

<SML confidence="1.000" text="el mes próximo" utteranceConfidence="1.000">
    <Month>9</Month> 
    <Year>2002</Year> 
</SML>

Example 5

User says: mayo del año dos mil tres.

SML returned by the recognition engine:

<SML confidence="1.000" text="mayo del año dos mil tres" utteranceConfidence="1.000"> 
    <Month confidence="1.000" text="mayo">5</Month> 
    <Year confidence="1.000" text="del año dos mil tres">2003</Year> 
</SML>

See Also

Voice Mode Grammar Library | DTMF Mode Grammar Library