DateBlock Rule for Spanish (United States)
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="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#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 hoy y el próximo miércoles.
SML returned by the recognition engine:
<SML confidence="1.000" text="entre hoy y el próximo miércoles">
<StartDate confidence="1.000" name="EvaluatedRelativeDate" text="hoy">
<Year confidence="1.000" name="Derived">2002</Year>
<Month confidence="1.000" name="Derived">8</Month>
<Day confidence="1.000" name="Derived">19</Day>
</StartDate>
<EndDate confidence="1.000" name="EvaluatedRelativeDate" text="próximo miércoles">
<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: desde el Año Nuevo de este año hasta el Día del trabajo.
SML returned by the recognition engine:
<SML confidence="1.000" text="desde el Año Nuevo de este año hasta el Día del trabajo" utteranceConfidence="1.000">
<StartDate confidence="1.000" name="Holiday" text="el Año Nuevo de este año">
<Year name="Derived" 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="Año Nuevo">NewYear</Holiday>
</StartDate>
<EndDate confidence="1.000" name="Holiday" text="el Día del trabajo">
<Year name="Derived" confidence="1.000">2005</Year>
<Month name="Derived" confidence="1.000">9</Month>
<Day name="Derived" confidence="1.000">5</Day>
<Holiday confidence="1.000" text="Día del trabajo">LaborDay</Holiday>
</EndDate>
</SML>
Example 3
Assume the current date is Monday, August 19, 2002. User says: a partir del Día del trabajo hasta el Año Nuevo.
SML returned by the recognition engine:
<SML confidence="1.000" text="a partir del Día del trabajo hasta el Año Nuevo" utteranceConfidence="1.000">
<StartDate confidence="1.000" name="Holiday" text="del Día del trabajo">
<Year name="Derived" confidence="1.000">2005</Year>
<Month name="Derived" confidence="1.000">9</Month>
<Day name="Derived" confidence="1.000">5</Day>
<Holiday confidence="1.000" text="Día del trabajo">LaborDay</Holiday>
</StartDate>
<EndDate confidence="1.000" name="Holiday" text="el Año Nuevo">
<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="Año Nuevo">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="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#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: a partir del viernes pasado.
The start date is evaluated and returned as a StartDate element.
SML returned by the recognition engine:
<SML confidence="1.000" text="a partir del viernes pasado" utteranceConfidence="1.000">
<StartDate confidence="1.000" name="EvaluatedRelativeDate" text="viernes pasado">
<Year name="Derived" confidence="1.000">2002</Year>
<Month name="Derived" confidence="1.000">8</Month>
<Day name="Derived" confidence="1.000">16</Day>
</StartDate>
</SML>
Example 2
Assume the current date is Monday, August 19, 2002. User says: desde el Año Nuevo.
The start date is evaluated and returned as a StartDate element.
SML returned by the recognition engine:
<SML confidence="1.000" text="desde el Año Nuevo" utteranceConfidence="1.000">
<StartDate confidence="1.000" name="Holiday"& text="Año Nuevo"gt;
<Year confidence="1.000" name="Assumed">2002</Year>
<Month confidence="1.000" name="Derived">1</Month>
<Day confidence="1.000" name="Derived">1</Day>
<Holiday confidence="1.000" text="Año Nuevo">NewYear</Holiday>
</StartDate>
</SML>
Example 3
Assume the current date is Monday, August 19, 2002. User says: después del próximo jueves.
The start date is evaluated and returned as a StartDate element.
SML returned by the recognition engine:
<SML confidence="1.000" text="después del próximo jueves" utteranceConfidence="1.000">
<StartDate confidence="1.000" name="EvaluatedRelativeDate" text="próximo jueves">
<Year name="Derived" confidence="1.000">2002</Year>
<Month name="Derived" confidence="1.000">8</Month>
<Day name="Derived" confidence="1.000">22</Day>
</StartDate>
</SML>
Example 4
Assume the current date is Monday, August 19, 2002. User says: después de mañana.
The start date is evaluated and returned as a StartDate element.
SML returned by the recognition engine:
<SML confidence="1.000" text="después de mañana" utteranceConfidence="1.000">
<StartDate confidence="1.000" name="EvaluatedRelativeDate" text="mañana">
<Year confidence="1.000" name="Derived">2002</Year>
<Month confidence="1.000" name="Derived">8</Month>
<Day confidence="1.000" name="Derived">20</Day>
</StartDate>
</SML>
Example 5
Assume the current date is Monday, August 19, 2002. User says: en los últimos cinco días.
The start date is evaluated and returned as a StartDate element.
SML returned by the recognition engine:
<SML confidence="1.000" text="en los últimos cinco días" 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 6
Assume the current date is Monday, August 19, 2002. User says: en los próximos cinco días.
The deadline is evaluated and returned as a Deadline element.
SML returned by the recognition engine:
<SML confidence="1.000" text="en los próximos cinco días" 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 7
Assume the current date is Monday, August 19, 2002. User says: para el próximo lunes.
The deadline is evaluated and returned as a Deadline element.
SML returned by the recognition engine:
<SML confidence="1.000" text="para el próximo lunes" utteranceConfidence="1.000">
<Deadline confidence="1.000" name="EvaluatedRelativeDate" text="el próximo lunes">
<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 8
Assume the current date is Monday, August 19, 2002. User says: antes del primero de marzo.
The deadline is evaluated and returned as a Deadline element.
SML returned by the recognition engine:
<SML confidence="1.000" text="antes del primero de marzo" utteranceConfidence="1.000">
<Deadline confidence="1.000" name="PreciseDate" text="del primero de marzo">
<Year name="Assumed" confidence="1.000">2003</Year>
<Month confidence="1.000" text="marzo" name="Common">3</Month>
<Day confidence="1.000" text="primero" name="Common">1</Day>
</Deadline>
</SML>
Example 9
Assume the current date is Monday, August 19, 2002. User says: antes de la Navidad.
The deadline is evaluated and returned as a Deadline element.
SML returned by the recognition engine:
<SML confidence="1.000" text="antes de la Navidad" utteranceConfidence="1.000">
<Deadline confidence="1.000" name="Holiday" text="la Navidad">
<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="Navidad">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="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#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: en la segunda mitad de este año.
The start date and end date are evaluated from the inference.
SML returned by the recognition engine:
<SML confidence="1.000" text="en la segunda mitad de este año" 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="de este año">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="de este año">2002</Year>
</EndDate>
</SML>
Example 2
Assume the current date is Monday, August 19, 2002. User says: en el primer trimestre del próximo año.
The start date and end date are evaluated from the inference.
SML returned by the recognition engine:
<SML confidence="1.000" text="en el primer trimestre del próximo año" utteranceConfidence="1.000">
<StartDate confidence="1.000">
<Month name="Derived" confidence="1.000">1</Month>
<Day name="Derived" confidence="1.000">1</Day>
<Year name="Assumed" confidence="1.000">2003</Year>
</StartDate>
<EndDate confidence="1.000">
<Month name="Derived" confidence="1.000">3</Month>
<Day name="Derived" confidence="1.000">31</Day>
<Year name="Assumed" confidence="1.000">2003</Year>
</EndDate>
</SML>
Example 3
Assume the current date is Monday, August 19, 2002. User says: en la primera semana de marzo.
The start date and end date are evaluated from the inference.
SML returned by the recognition engine:
<SML confidence="1.000" text="en la primera semana de marzo" utteranceConfidence="1.000">
<StartDate confidence="1.000">
<Month confidence="1.000" text="marzo">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="marzo">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: en la última semana de febrero.
The start date and end date are evaluated from the inference.
SML returned by the recognition engine:
<SML confidence="1.000" text="en la última semana de febrero" utteranceConfidence="1.000">
<StartDate confidence="1.000">
<Month confidence="1.000" text="febrero">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="febrero">2</Month>
<Day name="Derived" confidence="1.000">28</Day>
<Year name="Assumed" confidence="1.000">2002</Year>
</EndDate>
</SML>
Example 5
Assume the current date is Monday, August 19, 2002. User says: en el año dos mil cuatro.
The start date and end date are evaluated from the inference.
SML returned by the recognition engine:
<SML confidence="1.000" text="en el año dos mil cuatro" 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="CompleteForm" text="en el año dos mil cuatro">2004</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="CompleteForm" text="en el año dos mil cuatro">2004</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="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#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: esta semana.
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="esta semana" 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: el pasado fin de semana.
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="el pasado fin de semana" 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: este fin de semana que viene.
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="este fin de semana que viene" 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="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#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: en las próximas semanas.
SML returned by the recognition engine:
<SML confidence="1.000" text="en las próximas semanas" utteranceConfidence="1.000">
<ApproximatedDateBlock confidence="1.000">WithinAFewWeeks</ApproximatedDateBlock>
</SML>
Example 2
User says: dentro de un par de semanas.
SML returned by the recognition engine:
<SML confidence="1.000" text="dentro de un par de semanas" utteranceConfidence="1.000">
<ApproximatedDateBlock confidence="1.000">WithinAFewWeeks</ApproximatedDateBlock>
</SML>
Example 3
User says: pronto.
SML returned by the recognition engine:
<SML confidence="1.000" text="pronto" utteranceConfidence="1.000">
<ApproximatedDateBlock confidence="1.000">Soon</ApproximatedDateBlock>
</SML>