Partager via


CreditCard Rule for French (Canada)

  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="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#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) quatre un deux zéro un un un un zéro zéro un deux six un deux cinq

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

<SML confidence="1.000" luhnValidation="false" name="Visa" text="quatre un deux zéro un un un un zéro zéro un deux six un deux cinq" 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: quatre un deux zéro un un un un zéro zéro un deux six un deux cinq

SML returned by the recognition engine:

<SML confidence="1.000" luhnValidation="false" name="Visa" text="quatre un deux zéro un un un un zéro zéro un deux six un deux cinq" 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: cinquante et un vingt-quatre vingt-quatre soixante-deux un neuf zéro cinq deux trois un un

SML returned by the recognition engine:

<SML confidence="1.000" luhnValidation="false" name="Master" text="cinquante et un vingt-quatre vingt-quatre soixante-deux un neuf zéro cinq deux trois un un" 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 douze trente-quatre.

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

Examples: CreditCardExpirationDate

Example 1

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

SML returned by the recognition engine:

<SML confidence="1.000" text="zéro cinq zéro cinq" utteranceConfidence="1.000">
    <Month confidence="1.000" text="zéro cinq">5</Month>
    <Year confidence="1.000" text="zéro cinq">2005</Year> 
</SML>

Example 2

User says: mai l'année prochaine. Assume that the current month is February, 2002.

SML returned by the recognition engine:

<SML confidence="1.000" text="mai l'année prochaine" utteranceConfidence="1.000">
    <Month confidence="1.000" text="mai">5</Month> 
    <Year confidence="1.000" text="l'année prochaine">2003</Year> 
</SML>

Example 3

User says: juin zéro quatre.

SML returned by the recognition engine:

<SML confidence="1.000" text="juin zéro quatre" utteranceConfidence="1.000">
    <Month confidence="1.000" text="juin">6</Month> 
    <Year confidence="1.000" text="zéro quatre">2004</Year> 
</SML>

Example 4

User says: mai l'année deux mille trois.

SML returned by the recognition engine:

<SML confidence="1.000" text="mai l'année deux mille trois" utteranceConfidence="1.000"> 
    <Month confidence="1.000" text="mai">5</Month> 
    <Year confidence="1.000" text="l'année deux mille trois">2003</Year> 
</SML>

See Also

Voice Mode Grammar Library | DTMF Mode Grammar Library