Recognizers-Text icon indicating copy to clipboard operation
Recognizers-Text copied to clipboard

[Javascript | EN DateTimeV2] "After [day]" follows different resolution logic than "After [month]", "After [Year]"

Open apolya01 opened this issue 5 years ago • 0 comments

Describe the bug "after [day]" (e.g. "after monday") will produce date resolution values with 'start' field corresponding to the date of "[day]" ({start:2020-11-2}, if called before that date). "After [month]", "after [year]" (e.g. "after October", "after 2020") will produce date resolution beginning on the first date after those times (e.g. Nov 1/Jan 1, 2021, respectively).

To Reproduce Steps to reproduce the behavior:

  • Call Recognizers.recognizeDateTime("After Monday", Recognizers.Culture.English)
  • Observe that results[0].resolution.values[0] has 'start' field of unexpected value
  • Observe that results[0].resolution.values[1] has 'start' field of unexpected value

Expected behavior Resolution for "after [day]" utterances includes 'start' value that is truly after that day, to match "after [month]", "after [year]"

Sample input/output Recognizers.recognizeDateTime("After Monday", Recognizers.Culture.English)

'{"values":[
{"timex":"XXXX-WXX-1","Mod":"after","type":"daterange","sourceEntity":"datetimepoint","start":"2020-10-26"},
{"timex":"XXXX-WXX-1","Mod":"after","type":"daterange","sourceEntity":"datetimepoint","start":"2020-11-02"}
]}'

Platform (please complete the following information):

  • Platform: Javascript
  • Environment: npm package
  • Version of package 1.3.0

apolya01 avatar Oct 27 '20 17:10 apolya01