Summary:
While I was working on fixing #604, I came across the rules
`ruleMilitarySpelledOutAMPM(2)`, which were actually capturing
some of my test phrases and confusing me.
This commit removes them because
- they aren't needed: the existing latent spelled-out hour + minute rules plus
the "(in the )?(am/pm)" rules together give the same behavior
- they are confusingly named - these aren't military times at all, they are
spelled-out civilian times
Reviewed By: haoxuany
Differential Revision: D27848485
fbshipit-source-id: ba1ed16ec22b5139b0b500b44dc91adb1b5e3d82
Summary:
This fixes#592 in a very conservative way: the reason why `ruleIntersect` does
not detect "tonight 815" and "tonight eight fifteen" as it does "tonight 8:15"
is because it explicitly forbids the second part of the intersection from being
latent, unless it is a year.
I don't think it's a good idea to remove the restriction on latent inputs in
`ruleIntersect`, so instead I just made a new rule specifically for the
intersection of `<part-of-day> <time-of-day>`.
It also seems to me that there's a lot of room for this to be too aggressive,
for example if I say "tonight 500 people will laugh" the "tonight" and "500"
aren't really linked. So, I set the rule to be latent; this may be too conservative
to be useful though (do client libraries usually allow latent results?).
Reviewed By: chessai
Differential Revision: D27842596
fbshipit-source-id: 36ac59e31c632d4864241bce291147a46d52f780
Summary:
* "at the moment" is considered identical to "now".
* "ASAP" is considered identical to "from now"
Pull Request resolved: https://github.com/facebook/duckling/pull/405
Reviewed By: patapizza
Differential Revision: D26009483
Pulled By: chessai
fbshipit-source-id: addf4c509e69d413cae279601c64f72710eba11f
Summary:
Current:
"first monday of last month" -> the date of first monday starting from current time. Note here the term "last month" is dropped
Expected:
"first monday of last month" -> the date of first monday of previous month.
Reviewed By: chinmay87
Differential Revision: D22300243
fbshipit-source-id: 16622860c52ec2ce9c7a7bcd6094192255aa5a0b
Summary:
current:
last friday in october -> the date of Friday of previous week
expected:
last friday in october -> the data of last Friday of month october
Reviewed By: chinmay87
Differential Revision: D22201326
fbshipit-source-id: 1983c1b9c24aa356977af7def42d5ba07c7f08be
Summary:
the new rules could parse phrases in the form of
xxx upcoming weeks
upcoming xxx weeks
Pull Request resolved: https://github.com/facebook/duckling/pull/491
Test Plan: Imported from GitHub, without a Test Plan: line.
Differential Revision: D21959647
Pulled By: chinmay87
fbshipit-source-id: a062a8c7a6c2e23b921b1099b886fa589c69c454
Summary:
added new EN rule to parse the phrases that contain "midday".
Pull Request resolved: https://github.com/facebook/duckling/pull/490
Differential Revision: D21959562
Pulled By: chinmay87
fbshipit-source-id: f9ab45aecd551e8959d00b0025ed38b616ed6b14
Summary:
Leveraging `predNthClosest` helper in English rules.
"the second closest monday to february 6"
"the closest tax day to boss day 2018"
Reviewed By: haoxuany
Differential Revision: D20214444
fbshipit-source-id: b6be32f63097d221aa7ccc6df4e3639e4deee4a9
Summary: Supporting "orthodox good friday" in addition to "orthodox great friday" in the regex
Reviewed By: chinmay87
Differential Revision: D19604033
fbshipit-source-id: c6ca68fc34e284304ca2ba07a8f1bf81378c3558
Summary: modified the regex pattern for minutes to include m alone, as well as the regex pattern for ruleDurationDotNumeralHours to pass h, hr, and hrs
Reviewed By: patapizza
Differential Revision: D18799727
fbshipit-source-id: df4d0bd53407b427254169454e647e43e073795e
Summary: We weren't capturing cases like "the second of february" as it was matching with the "the <cycle> of <time>" rule
Differential Revision: D18249651
fbshipit-source-id: 09e214f585b96d07af4d5043de61445f4e156c54
Summary: We weren't capturing cases like "the first Saturday of the month", due to "the month" not being properly parsed.
Reviewed By: haoxuany
Differential Revision: D18193355
fbshipit-source-id: 2c4e83a3f22b0fe306ce7662ade85434a0016784
Summary:
Parts of day are time ranges, e.g. "tonight" is a range from 6:00pm to midnight. We have intersect logic in place to resolve a string like "tonight at 7pm" to one time, at 7pm. But if the time is outside of the part of day's range (e.g. "tonight at 5pm"), the string is resolved to 2 separate times ("tonight" and "at 5pm").
These changes resolve e.g. "tonight at xx" to "xx" irrespective of the range of tonight, as long as the am/pm makes sense (so "tonight at 5am" would still resolve to 2 separate times - "tonight" and at "5am").
"this/early morning at xx" gets resolved to "xx am". All other parts of day get resolved to "xx pm", with one exception: all parts of day resolve "... at 12" to midnight.
Differential Revision: D17694898
fbshipit-source-id: 1e24023759bb942659285d18a6a4d0b09f77c9da
Summary: Added support for Rama Navami holiday from 2000 to 2030
Reviewed By: chinmay87
Differential Revision: D17881237
fbshipit-source-id: f3f17d67d178fa8fbcb8ae640c3bfc17bc3e21d3
Summary: Added support for Ganesh/Vinayaka Chaturthi Hindu holiday from 2000 to 2030
Reviewed By: haoxuany
Differential Revision: D17675368
fbshipit-source-id: 2d53ad2592fc8d234bd7a3cbac2bddeaa45b220b
Summary:
Added dates for Ratha-Yatra
I double checked the dates, but still could have messed something up.
Reviewed By: patapizza
Differential Revision: D17358944
fbshipit-source-id: bf7c5f81c83c312166c5e3c960534606b95f0c2e
Summary: Improved the regex to support "saint"
Reviewed By: patapizza
Differential Revision: D17327533
fbshipit-source-id: 97b8290c416adbc4b32d543b01f408016c62075a
Summary: Previously Duckling was supporting Ramadan and Eid al-Fitr from 2000 to 2029. Now the range has been expanded to start from 1950.
Reviewed By: patapizza
Differential Revision: D17319760
fbshipit-source-id: 008ef7ffef77f293666a32381f663db07b8130ae
Summary: Adding support for Ugadi holiday from 2000 to 2030.
Reviewed By: chinmay87
Differential Revision: D17156412
fbshipit-source-id: b16f710912bf90a1a472661e31d83fbff7043cfe
Summary: Guarded against `isOkWithThisNext` for ruleThisTime, ruleNextTime and ruleLastTime. Changes based off of D16589879 and D7200945
Reviewed By: chinmay87
Differential Revision: D16678781
fbshipit-source-id: b1fba9067818d0cc587016651b35d54d5c70e621
Summary:
Essentially "for a quarter after <time-of-day>" gets matched with the "for <duration> from <time>" rule where "quarter" is interpreted as a duration of a few months.
Fixing this by allowing an optional preceding "for " in the quarter "quarter after|past <hour-of-day>" rule.
Reviewed By: chinmay87
Differential Revision: D16166518
fbshipit-source-id: 0215ec6a0dabf227194a14d15c87c8ed5539f9d1
Summary: Need to manually specify the dates due to differences in the Hindu and Gregorian calendars
Reviewed By: haoxuany
Differential Revision: D16151703
fbshipit-source-id: dfa8136fa133df5b31402fe4ab3825e97ad604aa
Summary: Adding support for 24h "h" time separator as in "23h45" and "23h".
Reviewed By: patapizza
Differential Revision: D15692699
fbshipit-source-id: 58ae8105ff97b887e9fe171927e89a7c444d7ed5
Summary: Make "the week" resolve to interval from `today` to `end of week`
Reviewed By: patapizza
Differential Revision: D15400571
fbshipit-source-id: 143fa2a8b7c30f1bee0ba8419926db90c680d036
Summary: We need to handle "N minutes past <time>".
Reviewed By: patapizza
Differential Revision: D15283767
fbshipit-source-id: 2a758e62c7af93b7f3c0e5856e38e3f040dcca03
Summary:
"What is the date three Fridays from now?" resolves incorrectly:
- On Friday, it detects "three fridays", "fridays from now"
- On other days, it detects "three fridays", "from now"
Thus, added a new rule, "<integer> <day-of-week> from <time>" to give the expected result of three Fridays after the current day and added test examples. If there are too many test examples, please let me know!
Reviewed By: chinmay87
Differential Revision: D15110770
fbshipit-source-id: a77b86de8b6d8f7c947df9e14edb17f61bcc8419
Summary:
`today in one hour` was returning a time interval starting at 1 hr from now and ending at 2 hr from now.
The expected value is a single value one hour from now. This is accomplished by restricting `"<day> in <duration>"` to operaton only on durations with a grain > Hour
Reviewed By: patapizza
Differential Revision: D15055912
fbshipit-source-id: c3141eba358036577d2e14f0d588a99af83f62be
Summary: Added dates for Eid al-Adha from Gregorian calendar years 1950 to 2000.
Reviewed By: patapizza
Differential Revision: D14492291
fbshipit-source-id: 7e5436ae2e5ded798753c29a0e94410a0d848dad
Summary:
Fixes [#218](https://github.com/facebook/duckling/issues/218)
**Note:** This is still a work in progress. But, I'm new to both Haskell and this repo and I seem to be stuck. Would appreciate feedback on what I've done so far. Thank you!
Pull Request resolved: https://github.com/facebook/duckling/pull/271
Reviewed By: chinmay87
Differential Revision: D13087476
Pulled By: patapizza
fbshipit-source-id: 2dee0d023794265bd791ae0bbc0e2e2b89ea1959
Summary: Adds support for Parsi New Year
Reviewed By: patapizza
Differential Revision: D10208163
fbshipit-source-id: 6c125ab4310cb81c239d9a2ee3c765a4a1841a5c
Summary: Extended Ramadan and Eid al-Fitr from 2029 to 2050 in computed.hs
Reviewed By: chinmay87
Differential Revision: D10304284
fbshipit-source-id: 5240046977632411bf067769499e6afbcda0af7b
Summary: Adding support for Guru Gobind Singh Jayanti holiday from 2000 to 2030.
Reviewed By: chinmay87
Differential Revision: D10148514
fbshipit-source-id: 79e35bcca37f7a87fc6b46fda41edf0a57b424a6
Summary:
It didn't intersect before, as `9` is latent and we were guarding against it.
Instead, guard against years (to prevent nonsensical things like `one ninety nine a.m.`) and against 2 latent tokens.
Reviewed By: chinmay87
Differential Revision: D9507044
fbshipit-source-id: 4c97eba8fc1e47bf7b9a78e04dd6b5531898fda6
Summary: Make rule for in <duration> at <time-of-day>
Reviewed By: patapizza
Differential Revision: D9375588
fbshipit-source-id: e0ebea53005b09e0ef8b70bf4f68d73b0f75df08
Summary:
"from 1:30 to 2pm" resolved to [1:30, 3pm[ with grain `Minute`.
It now resolves to [1:30, 2:01pm[ (same grain).
Reviewed By: chinmay87
Differential Revision: D9338769
fbshipit-source-id: b76c8cc8ac4b6227825c3d21431261f9fb552509