Partilhar via


Time Rule for French (Canada)

  Microsoft Speech Technologies Homepage

Retrieves the following kinds of time:

  • Common Time
  • Approximated Time

The Time rule does not support evaluated relative time. For example, "in one hour" is not recognized.

Common Time

Common time formats can be retrieved using the Time rule. A precise time is returned in 24-hour format using the Hour and Minute elements. There is no element necessary to hold A.M. or P.M. data. The Time rule recognizes the following phrases when used appropriately in combination with expressions of hours or of hours and minutes:

a.m., du matin, p.m., du soir, de l'après-midi, en soirée

When morning or afternoon is not specified and must be determined, the Time rule uses 7 A.M. to 7 P.M. as a preference and returns an alternative Hour element.

Rule

Time

Usage

<ruleref uri="cmnrules.cfg#Time"/>

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

JScript Objects

$common_time.Hour._value : integer
$common_time.Minute._value : integer
$common_time.AlternativeHour._value : integer (optional)

Examples: Common Time

Example 1

User says: deux heures trente de l'après-midi.

SML returned by the recognition engine:

<SML confidence="1.000" text="deux heures trente de l'après-midi" utteranceConfidence="1.000">
    <Hour confidence="1.000" text="deux heures de l'après-midi">14</Hour>
    <Minute confidence="1.000" text="trente">30</Minute>
</SML>

Example 2

User says: une heure de l'après-midi

SML returned by the recognition engine:

<SML confidence="1.000" text="une heure de l'après-midi" utteranceConfidence="1.000">
    <Hour confidence="1.000" text="une heure de l'après-midi">13</Hour>
    <Minute confidence="1.000">0</Minute>
</SML>

Example 3

User says: neuf heures du soir.

SML returned by the recognition engine:

<SML confidence="1.000" text="neuf heures du soir" utteranceConfidence="1.000">
    <Hour confidence="1.000" text="neuf heures du soir">21</Hour>
    <Minute confidence="1.000">0</Minute>
</SML>

Example 4

User says: treize heures quatre.

SML returned by the recognition engine:

<SML confidence="1.000" text="treize heures quatre" utteranceConfidence="1.000">
    <Hour confidence="1.000" text="treize heures">13</Hour>
    <Minute confidence="1.000" text="quatre">4</Minute>
</SML>

Example 5

User says: neuf heures moins cinq. Morning or afternoon is not specified. The Time module assumes A.M. and returns an alternative Hour element.

SML returned by the recognition engine:

<SML confidence="1.000" text="neuf heures moins cinq" utteranceConfidence="1.000">
    <Hour confidence="1.000" text="neuf neuress">8</Hour>
    <Minute confidence="1.000">55</Minute>
    <AlternativeHour confidence="1.000">20</AlternativeHour>
</SML>

Example 6

User says: sept heures une. Morning or afternoon is not specified. The Time module assumes A.M. and returns an alternative Hour element.

SML returned by the recognition engine:

<SML confidence="1.000" text="sept heures une" utteranceConfidence="1.000">
    <Hour confidence="1.000" text="sept heures">7</Hour>
    <Minute confidence="1.000" text="une">1</Minute>
    <AlternativeHour confidence="1.000">19</AlternativeHour>
</SML>

Example 7

User says: six heures cinquante-neuf. Morning or afternoon is not specified. The Time module assumes P.M. and returns an alternative Hour element.

SML returned by the recognition engine:

<SML confidence="1.000" text="six heures cinquante-neuf" utteranceConfidence="1.000">
    <Hour confidence="1.000" text="six heures">18</Hour>
    <Minute confidence="1.000" text="cinquante-neuf">59</Minute>
    <AlternativeHour confidence="1.000">6</AlternativeHour>
</SML>

Example 8

User says: dix heures moins le quart.

SML returned by the recognition engine:

<SML confidence="1.000" text="dix heures moins le quart" utteranceConfidence="1.000">
    <Hour confidence="1.000" text="dix heures">9</Hour>
    <Minute confidence="1.000">45</Minute>
    <AlternativeHour confidence="1.000">21</AlternativeHour>
</SML>

Example 9

User says: treize heures.

SML returned by the recognition engine:

<SML confidence="1.000" text="treize heures" utteranceConfidence="1.000">
    <Hour confidence="1.000" text="treize heures">13</Hour>
    <Minute confidence="1.000">0</Minute>
</SML>

Approximated Time

An approximated time is one that cannot reliably be represented by hour and minute elements. In cases of approximate time, the Time rule returns one of the following enumeration values to the application. Relative times are not supported with respect to approximate times. For example, a quarter before noon is not allowed.

Breakfast Lunch
Noon Dinner
After work Midnight
Now  

Rule

Time

Usage

<ruleref uri="cmnrules.cfg#Time" />

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

JScript Objects

$common_time.Hour._value: integer
$common_time.Minute._value: integer
$common_time.AlternativeHour._value: integer (optional)

Examples of Approximated Time

Example 1

User says: dîner.

SML returned by the recognition engine:

<SML confidence="1.000" text="dîner" utteranceConfidence="1.000">
    <ApproximatedTime confidence="1.000" text="dîner">Noon</ApproximatedTime>
</SML>

See Also

Voice Mode Grammar Library | DTMF Mode Grammar Library