Currency Rules for English (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 three currency rules describe a quantity of currency up to one million dollars and 99 cents.

Two of the currency rules limit the maximum quantity that can be recognized. The names of these two rules indicate the limit. For example, Currency_US_upto1000 accepts whole quantities up to and including $1000.00.

Rules

Currency_US

Currency_US_upto100

Currency_US_upto1000

Usage

<ruleref uri="Library.grxml#Currency_US" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Currency_US_upto100" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Currency_US_upto1000" type="application/srgs+xml"/>

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

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

JScript Objects

$Currency_US._value : float [0.00...1000000.99]
$Currency_US_upto100._value : float [0.00...100.00]
$Currency_US_upto1000._value : float [0.00...1000.00]

Examples: Currency

Example 1

User says: "one hundred dollars."

When the currency type is not mentioned, it is assumed to be dollars.

SML returned by the recognition engine.

<SML text="one hundred dollars" utteranceConfidence="1.000" confidence="1.000">100</SML>

Example 2

User says: "two dollars and fifteen cents."

SML returned by the recognition engine.

<SML text="two dollars and fifteen cents" utteranceConfidence="1.000" confidence="1.000">2.15</SML>

Example 3

User says: "ninety nine cents."

SML returned by the recognition engine.

<SML text="ninety nine cents" utteranceConfidence="1.000" confidence="1.000">0.99</SML>

Example 4

User says: "two dollars ninety nine cents."

SML returned by the recognition engine.

<SML text="two dollars ninety nine cents" utteranceConfidence="1.000" confidence="1.000">2.99</SML>

See Also

Concepts

Voice Mode Grammar Library for English (United States)