Numeral Rule for Spanish (United States)
Retrieves a number of a specified class. The class of the number is specified by the rule which is being activated. The following classes of numbers can be retrieved:
- Natural
- Integer
- Floating-point
- Fraction
- Cardinal
- Ordinal
Rules
Rule Name | Description |
---|---|
natural_number | A whole, non-negative integer (including zero). |
integer | A whole number that can be positive, negative, or zero. |
floating_point | A number that must contain a decimal point followed by at least one digit. |
fraction | A numerical representation indicating the quotient of two numbers. |
number | A generic rule that accepts all numbers, including integers, floating-point numbers, and fractions. |
Usage
<!-- using the natural_number rule as an example -->
<ruleref uri="cmnrules.cfg#natural_number"/>
The grammar can be used as follows:
<!-- using the natural_number rule as an example -->
<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#natural_number"/>
<tag>$ = $$</tag>
</rule>
</grammar>
JScript Object
$natural_number_value : integer
Examples: natural_number
Example 1
User says: cero.
SML returned by the recognition engine:
<SML confidence="1.000" text="cero" utteranceConfidence="1.000">0</SML>
Example 2
User says: dos mil quinientos.
SML returned by the recognition engine:
<SML confidence="1.000" text="dos mil quinientos" utteranceConfidence="1.000">2500</SML>
Example 3
User says: un billón tres millones cuatrocientos.
SML returned by the recognition engine:
<SML confidence="1.000" text="un billón tres millones cuatrocientos" utteranceConfidence="1.000">1003000400</SML>
Example 4
User says: cinco mil trescientos cinco.
SML returned by the recognition engine:
<SML confidence="1.000" text="cinco mil trescientos cinco" utteranceConfidence="1.000">5305</SML>
Examples: integer
Example 1
User says: cinco mil trescientos cinco.
SML returned by the recognition engine:
<SML confidence="1.000" text="cinco mil trescientos cinco" utteranceConfidence="1.000">5305</SML>
Example 2
User says: menos cinco mil trescientos cinco.
SML returned by the recognition engine:
<SML confidence="1.000" text="menos cinco mil trescientos cinco" utteranceConfidence="1.000">-5305</SML>
Examples: floating_point
Example 1
User says: positivo cinco mil trescientos cinco punto dos uno cinco.
SML returned by the recognition engine:
<SML confidence="1.000" text="positivo cinco mil trescientos cinco punto dos uno cinco" utteranceConfidence="1.000">5305.215</SML>
Example 2
User says: uno coma cero.
SML returned by the recognition engine:
<SML confidence="1.000" text="uno coma cero" utteranceConfidence="1.000">1</SML>
Examples: fraction
Example 1
User says: siete dieciseisavos.
SML returned by the recognition engine:
<SML confidence="1.000" text="siete dieciseisavos" utteranceConfidence="1.000">0.4375</SML>
Example 2
User says: uno y dos tercios.
SML returned by the recognition engine:
<SML confidence="1.000" text="uno y dos tercios" utteranceConfidence="1.000">1.66666666666667</SML>
Example 3
User says: tres cuartos.
SML returned by the recognition engine:
<SML confidence="1.000" text="tres cuartos" utteranceConfidence="1.000">0.75</SML>
Example: number
Example 1
User says: dos punto tres millones.
SML returned by the recognition engine:
<SML confidence="1.000" text="dos punto tres millones" utteranceConfidence="1.000">2300000</SML>