microsoft / Recognizers-Text

Microsoft.Recognizers.Text provides recognition and resolution of numbers, units, date/time, etc. in multiple languages (ZH, EN, FR, ES, PT, DE, IT, TR, HI, NL. Partial support for JA, KO, AR, SV). Packages available at: https://www.nuget.org/profiles/Recognizers.Text, https://www.npmjs.com/~recognizers.text
MIT License
1.68k stars 430 forks source link

[* DateTimeV2] Time inputs between 00:00 to 00:59 give invalid resolution #3010

Open Kevv-J opened 2 years ago

Kevv-J commented 2 years ago

Describe the bug forwarded from BotBuilder python SDK , giving time input between 00:00 to 00:59 to recognize_datetime() method gives invalid response that leads to DateTimePrompt giving TypeError: 'NoneType' object is not subscriptable.

To Reproduce Steps to reproduce the behavior:

  1. Create a Dialog with a DateTimePrompt() in BotBuilder SDK.
  2. When Prompted for input on chat send Input between 00:00 to 00:59
  3. See error on python console

Expected behavior It should ideally give 12:00 AM as a valid result for 00:00 as input or at least return incorrect result so user is prompted with retry_message.

Sample input/output 00:00 / Result object with resolution = None 00:59 / Result object with resolution = None 00:30 / Result object with resolution = None

Platform (please complete the following information):

Additional context It looks like on_recognize() method inside DateTimePrompt gets a result from recognize_datetime() method. The on_recognize() method expects to get results[0].resolution["values"] but the resolution attribute inside result received from recognize_datetime() is None for the given inputs.

Kevv-J commented 2 weeks ago

Hi @tellarin, any update on this issue? It seems to still be there in the latest version.

tellarin commented 2 weeks ago

@MichaelMWW, could you take a quick look?

MichaelMWW commented 1 week ago

@MichaelMWW, could you take a quick look?

The issue is fixed on master branch latest code but not released to PyPI yet, we will follow on it.