Recognizers-Text
Recognizers-Text copied to clipboard
[JavaScript | EN Datetime V2] Date phrases with date number spelled out ignore year part of phrase for resolution
Describe the bug Dates with the day number spelled out ignore the year part of resolution. Date phrases with numeric day numbers include the year.
To Reproduce Steps to reproduce the behavior:
- Call
Recognizers.recognizeDateTime("14th March 2016", Recognizers.Culture.English) - Observe that
results[0].resolution.values[0]has 'value' field of "2016-03-14" - Call
Recognizers.recognizeDateTime("Fourteenth of March 2016", Recognizers.Culture.English) - Observe that
results[0].resolution.values[0]has 'value' field of "2020-03-14" - Call
Recognizers.recognizeDateTime("Fourteenth March 2016", Recognizers.Culture.English) - Observe that
results[0].resolution.values[1]has 'value' field of "2021-03-14"
Expected behavior Phrases with same semantic meaning should offer same date resolution, inclusive of year part of phrase
Sample input/output
Recognizers.recognizeDateTime("14th March 2016", Recognizers.Culture.English)
{
values: [
{
timex: "2016-03-14",
type: "date",
value: "2016-03-14",
},
],
}
Recognizers.recognizeDateTime("Fourteenth of March 2016", Recognizers.Culture.English)
{
values: [
{
timex: "XXXX-03-14",
type: "date",
value: "2020-03-14",
},
{
timex: "XXXX-03-14",
type: "date",
value: "2021-03-14",
},
],
}
Platform (please complete the following information):
- Platform: Javascript
- Environment: npm package
- Version of package 1.3.0