Time Rule for Spanish (United States)
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 and 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., antes meridiano, del mediodía, de la madrugada, de la mañana, p. m., pasado meridiano, de esta noche, de la tarde, de la noche, de la medianoche |
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="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#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: las dos y media de la tarde.
SML returned by the recognition engine:
<SML confidence="1.000" text="las dos y media de la tarde" utteranceConfidence="1.000">
<Hour confidence="1.000" text="las dos de la tarde">14</Hour>
<Minute confidence="1.000" text="media">30</Minute>
</SML>
Example 2
User says: una p. m.
SML returned by the recognition engine:
<SML confidence="0.000" text="una p. m." utteranceConfidence="0.000">
<Hour confidence="0.000" text="una p. m.">13</Hour>
<Minute confidence="0.000">0</Minute>
</SML>
Example 3
User says: nueve en punto de la noche.
SML returned by the recognition engine:
<SML confidence="1.000" text="nueve en punto de la noche" utteranceConfidence="1.000">
<Hour confidence="1.000" text="nueve de la noche">21</Hour>
<Minute confidence="1.000" text="en punto">0</Minute>
</SML>
Example 4
User says: trece y cuatro.
SML returned by the recognition engine:
<SML confidence="1.000" text="trece y cuatro" utteranceConfidence="1.000">
<Hour confidence="1.000" text="trece">13</Hour>
<Minute confidence="1.000" text="cuatro">4</Minute>
</SML>
Example 5
User says: cinco minutos para las nueve. 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="cinco minutos para las nueve" utteranceConfidence="1.000">
<Hour confidence="1.000">8</Hour>
<Minute confidence="1.000"& text="cinco minutos para">55</Minute>
<AlternativeHour confidence="1.000">20</AlternativeHour>
</SML>
Example 6
User says: siete cero uno. 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="siete cero uno" utteranceConfidence="1.000">
<Hour confidence="1.000" text="siete">7</Hour>
<Minute confidence="1.000" text="uno">1</Minute>
<AlternativeHour confidence="1.000">19</AlternativeHour>
</SML>
Example 7
User says: seis cincuenta y nueve. 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="seis cincuenta y nueve" utteranceConfidence="1.000">
<Hour confidence="1.000" text="seis">6</Hour>
<Minute confidence="1.000" text="cincuenta y nueve">59</Minute>
</SML>
Example 8
User says: un cuarto para las diez de esta noche.
SML returned by the recognition engine:
<SML confidence="1.000" text="un cuarto para las diez de esta noche" utteranceConfidence="1.000">
<Hour confidence="1.000" text="diez de esta noche">21</Hour>
<Minute confidence="1.000" text="un cuarto para">45</Minute>
</SML>
Example 9
User says: las trece horas.
SML returned by the recognition engine:
<SML confidence="1.000" text="las trece horas" utteranceConfidence="1.000">
<Hour confidence="1.000" text="las trece">13</Hour>
<Minute>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="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#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: después del trabajo.
SML returned by the recognition engine:
<SML confidence="1.000" text="después del trabajo" utteranceConfidence="1.000">
<ApproximatedTime confidence="1.000" text="después del trabajo">EarlyEvening</ApproximatedTime>
</SML>