Duration Rule for Spanish (United States)
This library contains a DateBlockDuration rule that retrieves a duration expressed using a single unit of calendar time, and a TimeBlockDuration rule that retrieves a duration expressed using multiple units of clock time.
DateBlockDuration
Retrieves an integer number indicating duration in the following units:
- Years
- Hours
- Months
- Minutes
- Weeks
- Seconds
- Days
Rule
DateBlockDuration
Usage
<ruleref uri="cmnrules.cfg#DateBlockDuration" />
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#DateBlockDuration" />
<tag>$ = $$</tag>
</rule>
</grammar>
JScript Objects
$DateBlockDuration.Value._value : integer
$DateBlockDuration.Unit._value : string
Examples: Duration
Example 1
User says: tres meses.
SML returned by the recognition engine:
<SML confidence="1.000" text="tres meses" utteranceConfidence="1.000">
<Value confidence="1.000" text="tres">3</Value>
<Unit>Months</Unit>
</SML>
Example 2
User says: un día.
SML returned by the recognition engine:
<SML confidence="1.000" text="un día" utteranceConfidence="1.000">
<Value confidence="1.000" text="un">1</Value>
<Unit>Days</Unit>
</SML>
TimeBlockDuration
Retrieves the following units:
- Hours
- Seconds
- Days
Rule
TimeBlockDuration
Usage
<ruleref uri="cmnrules.cfg#TimeBlockDuration" />
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#TimeBlockDuration" />
<tag>$ = $$</tag>
</rule>
</grammar>
JScript Objects
$TimeBlockDuration.Hours._value : integer
$TimeBlockDuration.Minutes._value : integer
Example
Example 1
User says: noventa minutos.
SML returned by the recognition engine:
<SML confidence="1.000" text="noventa minutos" utteranceConfidence="1.000">
<Hours confidence="1.000" text="noventa minutos">1</Hours>
<Minutes confidence="1.000" text="noventa minutos">30</Minutes>
</SML>