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

extract_datetime_en() fails silently on "<of this/next/last> <year/month/week>", returns wrong datetime #59

Open
2 of 3 tasks
ChanceNCounter opened this issue Oct 21, 2019 · 6 comments
Labels
bug Something isn't working en relates to english language

Comments

@ChanceNCounter
Copy link
Contributor

ChanceNCounter commented Oct 21, 2019

https://github.com/MycroftAI/mycroft-core/blob/a3e35d736b0426f33b7fc1d1883be38e4b650b0b/mycroft/util/lang/parse_en.py#L667

Several cases not yet implemented and consequently parsing incorrectly:

  • "Yesterday: this one's probably somewhat urgent - may constitute a bug rather than unimplemented functionality
  • "of <this/next/last> <year/month/week>"
  • "# days <before X/after X/ago>" currently parses to "# days after today"
@ChanceNCounter
Copy link
Contributor Author

Thanks to this forum post by user tiredoftry for discovering this via asking about the weather

@JarbasAl
Copy link
Collaborator

JarbasAl commented Oct 22, 2019

i think the problem might be somewhere in the nice_date utils, doesn't sound like it is in extract_datetime because "yesterday" wasn't handled at all

fix for extracting "yesterday" and "X days ago" available in lingua_franca

@bolt25
Copy link

bolt25 commented Oct 25, 2019

i'm able to extract the "X days ago" part but i'm facing issues while dealing with "X days later"
but " in X days" works fine.
P.S - I'm using SpaCy to process the string

@ChanceNCounter
Copy link
Contributor Author

Suggest migrating this to Lingua Franca and editing to reflect the parts Jarbas has fixed, unless "yesterday" is regarded as critical enough to warrant porting that fix back here.

@forslund
Copy link
Collaborator

Good call. Yesterday we started pushing for getting lingua-franca used directly by core so it's definitely better to continue the work there.

@forslund forslund transferred this issue from MycroftAI/mycroft-core Dec 14, 2019
@ChanceNCounter ChanceNCounter changed the title extract_datetime_en() fails silently in several cases, returns wrong datetime extract_datetime_en() fails silently on "<of this/next/last> <year/month/week>", returns wrong datetime Jan 11, 2020
@ChanceNCounter ChanceNCounter added the bug Something isn't working label Jan 11, 2020
@JarbasAl
Copy link
Collaborator

#96 closes this

@JarbasAl JarbasAl added the en relates to english language label Nov 2, 2020
JarbasAl added a commit to OpenVoiceOS/ovos-lingua-franca that referenced this issue Apr 16, 2022
* partial fix/mycroft#39

- handle last/past year/month/week

* support for X day/week/month/year ago
support for weekends

* support for X day/week/month/year ago

* leave "this X" for a follow up PR

* next second/minute/hour

* within the XX

* more tests - better disambiguation

* more tests - X time later

* add tests for known failing cases "with the X"

* - fix offsets, use relativedelta
- handle X {time unit} earlier
- handle fractional decades/centuries/millenium
- handle decades/centuries/millenium ago
- add failing tests for extract last N {timeunit}

* fix "in the last N {timeunit}"

Co-authored-by: jarbasai <[email protected]>
@JarbasAl JarbasAl removed their assignment Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working en relates to english language
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants