Duration Rule for French (Canada)
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="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#DateBlockDuration" />
<tag>$ = $$</tag>
</rule>
</grammar>
JScript Objects
$DateBlockDuration.Value._value : integer
$DateBlockDuration.Unit._value : string
Examples: Duration
Example 1
User says: trois mois.
SML returned by the recognition engine:
<SML confidence="1.000" text="trois mois" utteranceConfidence="1.000">
<Value confidence="1.000" text="trois">3</Value>
<Unit>Months</Unit>
</SML>
Example 2
User says: un jour.
SML returned by the recognition engine:
<SML confidence="1.000" text="un jour" 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="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#TimeBlockDuration" />
<tag>$ = $$</tag>
</rule>
</grammar>
JScript Objects
$TimeBlockDuration.Hours._value : integer
$TimeBlockDuration.Minutes._value : integer
Example
Example 1
User says: quatre-vingt-dix minutes.
SML returned by the recognition engine:
<SML confidence="1.000" text="quatre-vingt-dix minutes" utteranceConfidence="1.000">
<Hours confidence="1.000" text="quatre-vingt-dix minutes">1</Hours>
<Minutes confidence="1.000" text="quatre-vingt-dix minutes">30</Minutes>
</SML>