Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extracting_datetime() returns incorrect values if a week day is included with the utterance #16

Open
JarbasAl opened this issue Feb 23, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@JarbasAl
Copy link
Member

original issue MycroftAI#187

extracting_datetime() returns incorrect values if a week day is included with the utterance.

To Reproduce

extract_datetime("monday april 5th")

returns

[datetime.datetime(2022, 4, 11, 0, 0, tzinfo=tzfile('/usr/share/zoneinfo/Australia/Darwin')), '']

Removing "monday" from the utterance returns the correct value.

dayOffset:
The problem is that weekdays in on itself are treated as relative words (what is reflected in dayOffset from now) -or in other words durations. And those durations collide with the specific date given
If you are parsing "monday may 3rd" you're asking "2 days from now after may 3rd"

Furthermore things like "Friday after May 3rd" are also not correctly parsed since the relative date (or anchorDate) should be may 3rd in that case, not datenow

@JarbasAl JarbasAl added the bug Something isn't working label Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant