DateBlock Rule for French (Canada)
Retrieves the following kinds of dates:
Date Type | Description |
---|---|
Hard Closed Date | Specified by a start and an end date. |
Hard Open Date | Specified by a start date or a deadline. |
Soft Closed Date | Specified by a common date unit. |
Evaluated Relative Date | A period of time that is bounded by a start date and an end date. |
Approximated Date | Future and past. |
The DateBlock rule is the only rule used to trigger all date blocks.
Hard Closed Date
A period of time that is bounded by a start date and an end date. The DateBlock rule returns both the start date and end date when an evaluated utterance is a hard closed date. The start date is contained in a StartDate element that contains, minimally, Year, Month, and Day elements. The end date is contained in an EndDate element containing the same elements.
Rule
DateBlock
Usage
<ruleref uri="cmnrules.cfg#DateBlock" />
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#DateBlock" />
<tag>$ = $$</tag>
</rule>
</grammar>
JScript Objects
$DateBlock.StartDate : $Date (optional)
$DateBlock.EndDate : $Date (optional)
$DateBlock.Deadline : $Date (optional)
$DateBlock.ApproximatedDateBlock : string (optional)
Examples: Hard Closed Date
Example 1
Assume the current date is Monday, August 19, 2002. User says: entre aujourd'hui et mercredi prochain.
SML returned by the recognition engine:
<SML confidence="1.000" text="entre aujourd'hui et mercredi prochain" utteranceConfidence="1.000">
<StartDate confidence="1.000" name="EvaluatedRelativeDate" text="aujourd'hui">
<Year name="Derived" confidence="1.000">2002</Year>
<Month name="Derived" confidence="1.000">8</Month>
<Day name="Derived" confidence="1.000">19</Day>
</StartDate>
<EndDate confidence="1.000" name="EvaluatedRelativeDate" text="mercredi prochain">
<Year name="Derived" confidence="1.000">2002</Year>
<Month name="Derived" confidence="1.000">8</Month>
<Day name="Derived" confidence="1.000">21</Day>
</EndDate>
</SML>
Example 2
Assume the current date is Monday, August 19, 2002. User says: du nouvelle année à la fête du travail.
SML returned by the recognition engine:
<SML confidence="1.000" text="du nouvelle année à la fête du travail" utteranceConfidence="1.000">
<StartDate confidence="1.000" name="Holiday" text="nouvelle année">
<Year name="Assumed" confidence="1.000">2002</Year>
<Month name="Derived" confidence="1.000">1</Month>
<Day name="Derived" confidence="1.000">1</Day>
<Holiday confidence="1.000" text="nouvelle année">NewYear</Holiday>
</StartDate>
<EndDate confidence="1.000" name="Holiday" text="fête du travail">
<Year name="Derived" confidence="1.000">2002</Year>
<Month name="Derived" confidence="1.000">9</Month>
<Day name="Derived" confidence="1.000">2</Day>
<Holiday confidence="1.000" text="fête du travail">LaborDay</Holiday>
</EndDate>
</SML>
Example 3
Assume the current date is Monday, August 19, 2002. User says: de la fête du travail au nouvelle année.
SML returned by the recognition engine:
<SML confidence="1.000" text="de la fête du travail au nouvelle année" utteranceConfidence="1.000">
<StartDate confidence="1.000" name="Holiday" text="fête du travail">
<Year name="Derived" confidence="1.000">2002</Year>
<Month name="Derived" confidence="1.000">9</Month>
<Day name="Derived" confidence="1.000">1</Day>
<Holiday confidence="1.000" text="fête du travail">LaborDay</Holiday>
</StartDate>
<EndDate confidence="1.000" name="Holiday" text="nouvelle année">
<Year name="Assumed" confidence="1.000">2005</Year>
<Month name="Derived" confidence="1.000">1</Month>
<Day name="Derived" confidence="1.000">1</Day>
<Holiday confidence="1.000" text="nouvelle année">NewYear</Holiday>
</EndDate>
</SML>
The above example returns a start date that is later than the end date. Currently, DateBlock does not determine whether the start date is before the end date.
Hard Open Date
A period of time that is specified by either a start date or deadline, but not both. The DateBlock rule returns the boundary date when an evaluated utterance is shown to be a hard open date. If the utterance is evaluated to a hard open date with a starting date, the date is returned within the StartDate element. If the utterance is evaluated to a hard open date with a deadline, the date is returned within the Deadline element.
Rule
DateBlock
Usage
<ruleref uri="cmnrules.cfg#DateBlock" />
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#DateBlock" />
<tag>$ = $$</tag>
</rule>
</grammar>
JScript Objects
$DateBlock.StartDate : $Date (optional)
$DateBlock.EndDate : $Date (optional)
$DateBlock.Deadline : $Date (optional)
$DateBlock.ApproximatedDateBlock : string (optional)
Examples: Hard Open Date
Example 1
Assume the current date is Monday, August 19, 2002. User says: dans les cinq derniers jours.
The start date is evaluated and returned as a StartDate element.
SML returned by the recognition engine:
<SML confidence="1.000" text="dans les cinq derniers jours" utteranceConfidence="1.000">
<StartDate confidence="1.000">
<Year name="Derived" confidence="1.000">2002</Year>
<Month name="Derived" confidence="1.000">8</Month>
<Day name="Derived" confidence="1.000"">14</Day>
</StartDate>
</SML>
Example 2
Assume the current date is Monday, August 19, 2002. User says: dans les cinq prochains jours.
The deadline is evaluated and returned as a Deadline element.
SML returned by the recognition engine:
<SML confidence="1.000" text="dans les cinq prochains jours" utteranceConfidence="1.000">
<Deadline confidence="1.000">
<Year name="Derived" confidence="1.000">2002</Year>
<Month name="Derived" confidence="1.000">8</Month>
<Day name="Derived" confidence="1.000">24</Day>
</Deadline>
</SML>
Example 3
Assume the current date is Monday, August 19, 2002. User says: d'ici lundi prochain.
The deadline is evaluated and returned as a Deadline element.
SML returned by the recognition engine:
<SML confidence="1.000" text="d'ici lundi prochain" utteranceConfidence="1.000">
<Deadline confidence="1.000" name="EvaluatedRelativeDate" text="lundi prochain">
<Year name="Derived" confidence="1.000">2002</Year>
<Month name="Derived" confidence="1.000">8</Month>
<Day name="Derived" confidence="1.000">26</Day>
</Deadline>
</SML>
Example 4
Assume the current date is Monday, August 19, 2002. User says: avant le premier mars.
The deadline is evaluated and returned as a Deadline element.
SML returned by the recognition engine:
<SML confidence="1.000" text="avant le premier mars" utteranceConfidence="1.000">
<Deadline confidence="1.000" name="PreciseDate" text="le premier mars">
<Year name="Assumed" confidence="1.000">2003</Year>
<Month confidence="1.000" text="mars" name="Common">3</Month>
<Day confidence="1.000" text="le premier" name="Common">1</Day>
</Deadline>
</SML>
Example 5
Assume the current date is Monday, August 19, 2002. User says: avant Noël.
The deadline is evaluated and returned as a Deadline element.
SML returned by the recognition engine:
<SML confidence="1.000" text="avant Noël" utteranceConfidence="1.000">
<Deadline confidence="1.000" name="Holiday" text="Noël">
<Year name="Assumed" confidence="1.000">2002</Year>
<Month name="Derived" confidence="1.000">12</Month>
<Day name="Derived" confidence="1.000">25</Day>
<Holiday confidence="1.000" text="Noël">Christmas</Holiday>
</Deadline>
</SML>
Soft Closed Date
A period of time that is specified by both a start date and an end date. The boundary dates are calculated from commonly used phrases that refer to dates. For example, the user might say, "the second half of the year." The DateBlock rule returns both the start date and end date when an evaluated utterance is shown to be a soft closed date. The start date is enclosed in a StartDate element that contains, minimally, Year, Month, and Day elements. The end date is enclosed in an EndDate element containing the same elements.
Rule
DateBlock
Usage
<ruleref uri="cmnrules.cfg#DateBlock" />
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#DateBlock" />
<tag>$ = $$</tag>
</rule>
</grammar>
JScript Objects
$DateBlock.StartDate : $Date (optional)
$DateBlock.EndDate : $Date (optional)
$DateBlock.Deadline : $Date (optional)
$DateBlock.ApproximatedDateBlock : string (optional)
Examples: Soft Closed Date
Example 1
Assume the current date is Monday, August 19, 2002. User says: dans la seconde moitié de cette année.
The start date and end date are evaluated from the inference.
SML returned by the recognition engine:
<SML confidence="1.000" text="dans la seconde moitié de cette année" utteranceConfidence="1.000">
<StartDate confidence="1.000">
<Month name="Derived" confidence="1.000">7</Month>
<Day name="Derived" confidence="1.000">1</Day>
<Year confidence="1.000" name="Derived" text="cette année">2002</Year>
</StartDate>
<EndDate confidence="1.000">
<Month name="Derived" confidence="1.000">12</Month>
<Day name="Derived" confidence="1.000">31</Day>
<Year confidence="1.000" name="Derived" text="cette année">2002</Year>
</EndDate>
</SML>
Example 2
Assume the current date is Monday, August 19, 2002. User says: dans le dernier quart de l'année prochaine.
The start date and end date are evaluated from the inference.
SML returned by the recognition engine:
<SML confidence="1.000" text="dans le dernier quart de l'année prochaine" utteranceConfidence="1.000">
<StartDate confidence="1.000">
<Month name="Derived" confidence="1.000">1</Month>
<Day name="Derived" confidence="1.000">1</Day>
<Year confidence="1.000" name="Derived" text="l'année prochaine">2003</Year>
</StartDate>
<EndDate confidence="1.000">
<Month name="Derived" confidence="1.000">3</Month>
<Day name="Derived" confidence="1.000">31</Day>
<Year confidence="1.000" name="Derived" text="l'année prochaine">2003</Year>
</EndDate>
</SML>
Example 3
Assume the current date is Monday, August 19, 2002. User says: dans la première semaine de mars.
The start date and end date are evaluated from the inference.
SML returned by the recognition engine:
<SML confidence="1.000" text="dans la première semaine de mars" utteranceConfidence="1.000">
<StartDate confidence="1.000">
<Month confidence="1.000" text="mars">3</Month>
<Day name="Derived" confidence="1.000">1</Day>
<Year name="Assumed" confidence="1.000">2002</Year>
</StartDate>
<EndDate confidence="1.000">
<Month confidence="1.000" text="mars">3</Month>
<Day name="Derived" confidence="1.000">7</Day>
<Year name="Assumed" confidence="1.000">2002</Year>
</EndDate>
</SML>
Example 4
Assume the current date is Monday, August 19, 2002. User says: dans la dernière semaine de février.
The start date and end date are evaluated from the inference.
SML returned by the recognition engine:
<SML confidence="1.000" text="dans la dernière semaine de février" utteranceConfidence="1.000">
<StartDate confidence="1.000">
<Month confidence="1.000" text="février">2</Month>
<Day name="Derived" confidence="1.000">22</Day>
<Year name="Assumed" confidence="1.000">2002</Year>
</StartDate>
<EndDate confidence="1.000">
<Month confidence="1.000" text="février">2</Month>
<Day name="Derived" confidence="1.000">28</Day>
<Year name="Assumed" confidence="1.000">2002</Year>
</EndDate>
</SML>
Evaluated Relative Date
A period of time that is bounded by a start date and an end date. The boundaries are determined by evaluating a reference. The DateBlock rule returns both the start date and end date for an evaluated relative date. The start date is enclosed in a StartDate element that contains, minimally, Year, Month, and Day elements. The end date is enclosed in an EndDate element that contains the same elements.
Rule
DateBlock
Usage
<ruleref uri="cmnrules.cfg#DateBlock" />
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#DateBlock" />
<tag>$ = $$</tag>
</rule>
</grammar>
JScript Objects
$DateBlock.StartDate : $Date (optional)
$DateBlock.EndDate : $Date (optional)
$DateBlock.Deadline : $Date (optional)
$DateBlock.ApproximatedDateBlock : string (optional)
Examples: Evaluated Relative Date
Example 1
Assume the current date is Monday, August 19, 2002. User says: cette semaine.
The start and end dates are evaluated and returned as StartDate and EndDate elements.
SML returned by the recognition engine:
<SML confidence="1.000" text="cette semaine" utteranceConfidence="1.000">
<StartDate confidence="1.000">
<Year name="Derived" confidence="1.000">2002</Year>
<Month name="Derived" confidence="1.000">8</Month>
<Day name="Derived" confidence="1.000">18</Day>
</StartDate>
<EndDate confidence="1.000">
<Year name="Derived" confidence="1.000">2002</Year>
<Month name="Derived" confidence="1.000">8</Month>
<Day name="Derived" confidence="1.000">24</Day>
</EndDate>
</SML>
Example 2
Assume the current date is Monday, August 19, 2002. User says: le week-end dernier.
The start and end dates are evaluated and returned as StartDate and EndDate elements.
SML returned by the recognition engine:
<SML confidence="1.000" text="le week-end dernier" utteranceConfidence="1.000">
<StartDate confidence="1.000">
<Year name="Derived" confidence="1.000">2002</Year>
<Month name="Derived" confidence="1.000">8</Month>
<Day name="Derived" confidence="1.000">17</Day>
</StartDate>
<EndDate confidence="1.000">
<Year name="Derived" confidence="1.000">2002</Year>
<Month name="Derived" confidence="1.000">8</Month>
<Day name="Derived" confidence="1.000">18</Day>
</EndDate>
</SML>
Example 3
Assume the current date is Monday, August 19, 2002. User says: le week-end prochain.
The start and end dates are evaluated and returned as StartDate and EndDate elements.
SML returned by the recognition engine:
<SML confidence="1.000" text="le week-end prochain" utteranceConfidence="1.000">
<StartDate confidence="1.000">
<Year name="Derived" confidence="1.000">2002</Year>
<Month name="Derived" confidence="1.000">8</Month>
<Day name="Derived" confidence="1.000">24</Day>
</StartDate>
<EndDate confidence="1.000">
<Year name="Derived" confidence="1.000">2002</Year>
<Month name="Derived" confidence="1.000">8</Month>
<Day name="Derived" confidence="1.000">25</Day>
</EndDate>
</SML>
Approximated Date
Approximated date blocks do not contain boundary dates. The DateBlock rule returns one of a set of enumeration values to the application. The set of enumeration values defined are:
- WithinAFewDays
- InThePastFewDays
- WithinAFewWeeks
- InThePastFewMonths
- WithinAFewMonths
- InThePastFewMonths
- Soon
Rule
DateBlock
Usage
<ruleref uri="cmnrules.cfg#DateBlock" />
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#DateBlock" />
<tag>$ = $$</tag>
</rule>
</grammar>
JScript Objects
$DateBlock.StartDate : $Date (optional)
$DateBlock.EndDate : $Date (optional)
$DateBlock.Deadline : $Date (optional)
$DateBlock.ApproximatedDateBlock : string (optional)
Examples: Approximated Date
Example 1
User says: dans quelques jours.
SML returned by the recognition engine:
<SML confidence="1.000" text="dans quelques jours" utteranceConfidence="1.000">
<ApproximatedDateBlock confidence="1.000" text="dans quelques jours">WithinAFewDays</ApproximatedDateBlock>
</SML>
Example 2
User says: dans les semaines suivantes.
SML returned by the recognition engine:
<SML confidence="1.000" text="dans les semaines suivantes" utteranceConfidence="1.000">
<ApproximatedDateBlock confidence="1.000">WithinAFewWeeks</ApproximatedDateBlock>
</SML>
Example 3
User says: dans quelques semaines.
SML returned by the recognition engine:
<SML confidence="1.000" text="dans quelques semaines" utteranceConfidence="1.000">
<ApproximatedDateBlock confidence="1.000">WithinAFewWeeks</ApproximatedDateBlock>
</SML>
Example 4
User says: bientôt.
SML returned by the recognition engine:
<SML confidence="1.000" text="bientôt" utteranceConfidence="1.000">
<ApproximatedDateBlock confidence="1.000" text="bientôt">Soon</ApproximatedDateBlock>
</SML>