Time Rules for English (United Kingdom)
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
Time rules recognize expressions of time based on a 12-hour clock.
When the user does not specify morning or afternoon, the Time rule returns a value in the Hour element representing the hours from 7 A.M. to 6 P.M. as the assumed value and a value in the AlternateHour hour element representing the hours from 7 P.M. to 6 A.M.
Time rules recognize expressions such as the following: "twelve a. m.; seven o'clock; seven thirty p.m.; five minutes before six o'clock p. m.; two past ten; a quarter till ten; half past three o'clock p.m.; three fifteen; six twenty at night; ten of five; two in the morning."
Rules
Time
Time_Hour
Time_HourNum
Time_BeforeAfter
Time_Minute
Time_AmPm
Usage
<ruleref uri="Library.grxml#Time" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Time_Hour" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Time_HourNum" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Time_BeforeAfter" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Time_Minute" type="application/srgs+xml"/>
<ruleref uri="Library.grxml#Time_AmPm" type="application/srgs+xml"/>
The grammar can be used as follows (using the Time rule as an example).
<grammar xmlns:sapi="http://schemas.microsoft.com/Speech/2002/06/SRGSExtensions"
xml:lang="en-GB" tag-format="semantics-ms/1.0" version="1.0" mode="voice"
root="Rule1" xmlns="http://www.w3.org/2001/06/grammar">
<rule id="Rule1" scope="public">
<ruleref uri="Library.grxml#Time" type="application/srgs+xml"/>
<tag>$ = $$</tag>
</rule>
</grammar>
JScript Objects
Rule Name | Returned JScript objects |
---|---|
Time |
|
Time_Hour |
|
Time_HourNum |
|
Time_BeforeAfter |
|
Time_Minute |
|
Time_AmPm |
|
Examples: Time
Example 1
User says: "Seven thirty P. M."
SML returned by the recognition engine.
<SML text="seven thirty P. M." utteranceConfidence="1.000" confidence="1.000">
????????<Hour confidence="1.000" name="Explicit">19</Hour>
????????<Minute confidence="1.000">30</Minute>
</SML>
Example 2
User says: "Seven thirty."
SML returned by the recognition engine.
<SML text="seven thirty" utteranceConfidence="1.000" confidence="1.000">
????????<Hour confidence="1.000" name="Assumed">7</Hour>
????????????????<Minute confidence="1.000">30</Minute>
????????????????<AlternateHour confidence="1.000">19</AlternateHour>
</SML>
Examples: Time_BeforeAfter
Example 1
User says: "A quarter past."
SML returned by the recognition engine.
<SML text="a quarter past" utteranceConfidence="1.000" confidence="1.000">15</SML>
Example 2
User says: "Forty three to."
SML returned by the recognition engine.
<SML text="engb
" utteranceConfidence="1.000" confidence="1.000">-43</SML>
Examples: Time_AmPm
Example 1
User says: "A.M."
SML returned by the recognition engine.
<SML text="A. M." utteranceConfidence="1.000" confidence="1.000">AM</SML>
Example 2
User says: "In the evening."
SML returned by the recognition engine.
<SML text="in the evening" utteranceConfidence="1.000" confidence="1.000">PM</SML>