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

fix MycroftAI/lingua-franca/issues/59 + 225 #11

Merged
merged 11 commits into from
Apr 16, 2022

Conversation

NeonJarbas
Copy link

@NeonJarbas NeonJarbas commented Feb 22, 2022

closes #14 , partially fixes #15

  • handle weekends
  • handle last/past second/minute/hour/day/week/weekend/month/year/decade
  • handle next second/minute/hour/day/week/weekend/month/year
  • handle in a second/minute/hour/day/week/weekend/month/year
  • handle #N second/minute/hour/day/week/weekend/month/year/decades/centuries/millenium ago / earlier
  • handle within a second/minute/day/hour/week/weekend/month/year
  • handle {float}/fractional decades/centuries/millenium e.g. "in 1.5 centuries"

notes on disambiguation:

  • in a month -> + 1 month timedelta
  • next month -> day 1 of next month
  • we can not disambiguate within a/the {unit} because normalize step removes the articles
    • "within a month" -> month is a timedelta of 30 days
    • "within the month" -> before 1st day of next month

TODO:

  • parse "this week/day/month/xxx" in follow up PR

@JarbasAl JarbasAl added the bug Something isn't working label Feb 22, 2022
@NeonJarbas NeonJarbas marked this pull request as ready for review February 22, 2022 20:32
@NeonJarbas NeonJarbas changed the title partial fix/mycroft#39 fix MycroftAI/lingua-franca/issues/225 Feb 22, 2022
@NeonJarbas NeonJarbas changed the title fix MycroftAI/lingua-franca/issues/225 fix MycroftAI/lingua-franca/issues/59 + 225 Feb 22, 2022
# datetime(2017, 6, 10) -> saturday <- this is being extracted
# self.assertEqual(
# extract_datetime('i have things to do next weekend', dt)[0],
# extract_datetime('i have things to do next saturday', dt)[0])
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new bug detected, "next saturday" is not parsing well, possibly related to #16

@ChanceNCounter
Copy link

I'm marking this for review sometime when I've got a whole hour for it, since there's so much to cross-reference.

@codecov
Copy link

codecov bot commented Apr 11, 2022

Codecov Report

❗ No coverage uploaded for pull request base (dev@8e98923). Click here to learn what that means.
The diff coverage is n/a.

@@          Coverage Diff          @@
##             dev     #11   +/-   ##
=====================================
  Coverage       ?   0.00%           
=====================================
  Files          ?      58           
  Lines          ?   14474           
  Branches       ?       0           
=====================================
  Hits           ?       0           
  Misses         ?   14474           
  Partials       ?       0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e98923...8563c26. Read the comment docs.

@JarbasAl JarbasAl requested a review from NeonDaniel April 11, 2022 13:51
@NeonDaniel
Copy link
Member

closes #14 , partially fixes #15

Just highlighting that this will close #15 on merge because of the fixes keyword

lingua_franca/lang/parse_en.py Show resolved Hide resolved
lingua_franca/lang/parse_en.py Show resolved Hide resolved
datetime(2018, 1, 1, tzinfo=default_timezone()))

# old test moved here due to new disambiguation between "next week" and "in a week"
# testExtract("remind me to call mom next week",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment here is implemented below; consider removing comment?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be removed, is just documenting the difference in expected output, this test expects different things in mycroft and ovos

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, missed that the times are different

@JarbasAl JarbasAl merged commit 9555f3d into OpenVoiceOS:dev Apr 16, 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
4 participants