Commit Graph

740 Commits

Author SHA1 Message Date
Anne Chen
332e0cc0a7 Translate periodic holidays
Summary:
Add the support for periodic holidays in Spanish (the ones that make sense in the language).

Skipped Periodic Holidays:
Año Nuevo, Navidad, Nochevieja: These holidays already had rules defined for them in the Rules file (see ruleAnoNuevo, ruleNavidad, ruleNochevieja)
Ugadi: This holiday does not have a translation into Spanish.

Note: Ignoring Lint issues for "Line too long", to follow convention set by original file / previous diffs.

Reviewed By: chinmay87

Differential Revision: D17506908

fbshipit-source-id: 7b43768443dcd4f020a20758995a63ab88706b35
2019-09-25 12:48:20 -07:00
Michael Voegele
4218897f64 Translated all computed holidays from English into German and added HolidayHelpers to reduce code duplication.
Summary: Added German langauage support for all computed holidays currently supported in English. Also created HolidayHelpers, which contains more complex holiday calculations used across languages.

Reviewed By: patapizza

Differential Revision: D17386163

fbshipit-source-id: 9dd88f8b0d699e5d7254a5ba7114bfa01b15176a
2019-09-20 18:32:13 -07:00
Karoly Szabo
71e1b9760d Translate periodic holidays
Summary: Adding support for periodic holidays in Italian

Reviewed By: chinmay87

Differential Revision: D17204304

fbshipit-source-id: 06adf1c5f673263cab7269033d2a312baca842eb
2019-09-18 02:17:00 -07:00
Hao Wang
c5f697ba5a Add support for computed holidays in ZH
Reviewed By: chinmay87

Differential Revision: D17431708

fbshipit-source-id: 88b95877f49c0f46e4c9817020c266c37974daa2
2019-09-17 15:34:08 -07:00
l5t
de8af2395d EN/FR support temperature with decimal values (#408)
Summary:
Allowing the support of decimal values like in human body temperature. Example: 98.6°F
Pull Request resolved: https://github.com/facebook/duckling/pull/408

Reviewed By: girifb

Differential Revision: D17401806

Pulled By: patapizza

fbshipit-source-id: f04b768e2f6cb48c9c50977a5807d62e38f8d545
2019-09-17 10:34:25 -07:00
Michael LeMay
1fa17b01d4 Time/EN: Added Ratha-Yatra holiday
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
2019-09-16 14:20:21 -07:00
Chinmay Deshmukh
fd8eb2190a En/Time: Support "Saint" Patrick's Day
Summary: Improved the regex to support "saint"

Reviewed By: patapizza

Differential Revision: D17327533

fbshipit-source-id: 97b8290c416adbc4b32d543b01f408016c62075a
2019-09-12 16:31:43 -07:00
Diego Dainese
c9baa741f9 Time: Extend support for Ramadan and Eid al-Fitr from 1950 to 2000
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
2019-09-11 23:48:16 -07:00
Sergei Rybalkin
70681e3302 latent entities
Summary:
Adding latent matching rules.
Matching Numerical to QuantityData with Unnamed as unit

Reviewed By: chinmay87

Differential Revision: D17225711

fbshipit-source-id: 8e423454e5e7b83eb8de4cabfd4f85a2a35b7a6d
2019-09-10 10:46:42 -07:00
Sergei Rybalkin
721e3f48db fix missing latent corpus in tests
Reviewed By: chinmay87

Differential Revision: D17225649

fbshipit-source-id: 5a41372737c31e87ec944824b852516de531d376
2019-09-10 10:31:51 -07:00
Sergei Rybalkin
961930b1ea Add Ugadi holiday
Summary: Adding support for Ugadi holiday from 2000 to 2030.

Reviewed By: chinmay87

Differential Revision: D17156412

fbshipit-source-id: b16f710912bf90a1a472661e31d83fbff7043cfe
2019-09-06 14:57:30 -07:00
Terrance Liang
a63d631a23 reuse helpers
Summary:
guard against `isOkWithThisNext` for ruleThisTime, ruleNextTime and ruleLastTime.

Required changes to be made in ruleNoon, ruleMidnight, and ruleWeekend

Reviewed By: patapizza

Differential Revision: D16999895

fbshipit-source-id: 2c18bd39692389f7e6a9d2fb82802e9dc509893d
2019-09-03 11:18:11 -07:00
Chinmay Deshmukh
436a97e738 Duration/EN: <integer> and a half minutes
Summary: Add rule for "<integer> and a half minutes"

Differential Revision: D17108126

fbshipit-source-id: beaf3eea976572fdec292df6c17303abeb8fcdbf
2019-08-30 13:32:36 -07:00
Julien Odent
a0ca037668 Add back Copyright header to EN_GB classifiers
Summary: as title

Reviewed By: chinmay87

Differential Revision: D16902441

fbshipit-source-id: 9b6d1fe9696191dffef5af315a47666edf715c0d
2019-08-19 22:06:57 -07:00
Shubham Khandelwal
f2af9422bd Add Pargat Diwas holiday | T28481361
Summary:
Adding support for Pargat Diwas holiday from 2000 to 2030. Made changes to:
- corpus.hs (included test)
- computed.hs (included dates): Dates were checked on the sources:
    * https://www.drikpanchang.com/hindu-saints/valmiki/maharishi-valmiki-jayanti.html?year=2020 (year being changed)
    * https://www.festivalsdatetime.co.in/2018/11/2020-valmiki-jayanti-date-and-time-2020.html?m=1 (year being changed)

    For conflicting dates (one day difference), chose www.drikpanchang.com as the primary choice.
- rules.hs (included regex for the festival)

Generated all the related classifiers

Reviewed By: chinmay87

Differential Revision: D16721179

fbshipit-source-id: c3c1023b39ca616374a5d936c08352ee0d4b210d
2019-08-10 01:36:02 -07:00
Hayley Russell
d03423cff5 Reuse helpers
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
2019-08-07 15:33:18 -07:00
Simran Suresh Motwani
a20b98a8ec Reuse helpers
Summary: Reuse mkRuleHolidays, mkRuleSeasons, mkRuleDaysOfWeek, mkRuleMonths in the Arabic rules for Time, and guard against `isOkWithThisNext` for ruleThisTime, ruleNextTime and ruleLastTime.

Reviewed By: chinmay87

Differential Revision: D16589997

fbshipit-source-id: f8e6d7fb6362abc314aa9eb04bfa4b965e1d1e41
2019-08-01 14:46:24 -07:00
Jae Lee
125ab967e0 Use mkRuleDaysOfWeek for KO language
Summary: Use mkRuleDaysOfWeek for KO language.

Reviewed By: patapizza

Differential Revision: D16441936

fbshipit-source-id: 1bee48cd59caede92cf43056ea5aa4d953827318
2019-07-31 16:20:22 -07:00
Jae Lee
fa386a548e Use mkRuleSeason for KO language
Summary: Use mkRuleSeason for KO language.

Reviewed By: patapizza

Differential Revision: D16441908

fbshipit-source-id: 94c450461fe788561dbf41e7b811de3d699f504d
2019-07-31 16:20:22 -07:00
Jae Lee
70dde3bc60 Use mkRuleHoliday for KO language
Summary: Use mkRuleHoliday for KO language

Reviewed By: patapizza

Differential Revision: D16441727

fbshipit-source-id: 167c47ed5f3960e9ab68d9b4b444ae9f1c63eda5
2019-07-31 16:20:21 -07:00
Sindhu Vempati
e8ecb23113 added Maha Shivaratri holiday to Duckling
Reviewed By: chinmay87

Differential Revision: D16504890

fbshipit-source-id: fc4f1392203cc22a9c4cee7a6d4317a12a0cb85c
2019-07-29 14:20:01 -07:00
Jae Lee
7e17d31201 Added Mahavir Jayanti holiday
Summary: Added Mahavir Jayanti holiday from 2000 to 2030.

Reviewed By: chinmay87

Differential Revision: D16380984

fbshipit-source-id: 025127cfab312645ec622527a217a910a55179d3
2019-07-22 08:31:36 -07:00
Kai Jun Weng
9e96ac802a Time/EN Support for a quarter after <hour-of-day>
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
2019-07-10 18:01:56 -07:00
Michael Guarino
ef0919055f Add Karva Chauth to duckling
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
2019-07-10 13:16:51 -07:00
Amit Manchanda
e38a852138 Update: add new dimension to a language
Summary: Pull Request resolved: https://github.com/facebook/duckling/pull/384

Reviewed By: patapizza

Differential Revision: D16150013

Pulled By: haoxuany

fbshipit-source-id: 5ef22efb84120337749dd29c3d33d507502c3e4c
2019-07-09 15:21:34 -07:00
Sasa Milic
b29bb5d3ed Support for intervals
Summary:
- Supports singular (like English "a")
- Supports intervals (e.g. EUR 100-200)
- Supports open intervals (like English "more than", "less than")

Reviewed By: haoxuany

Differential Revision: D16069296

fbshipit-source-id: 74808ad28f5673c2ca82f07dcc0934f82910b566
2019-07-02 13:34:55 -07:00
Filipe Correia
7341556898 Time/EN: Adding support for <hour>h<min>
Summary: Adding support for 24h "h" time separator as in "23h45" and "23h".

Reviewed By: patapizza

Differential Revision: D15692699

fbshipit-source-id: 58ae8105ff97b887e9fe171927e89a7c444d7ed5
2019-06-28 08:16:42 -07:00
Chinmay Deshmukh
a9438734c9 Duration/en: 5 additional minutes
Summary: Support more words in rule `ruleDurationNumeralMore`

Reviewed By: patapizza

Differential Revision: D15501197

fbshipit-source-id: feb12cd27dfb964e1e404b1d902828000c9fa4f7
2019-06-03 18:02:51 -07:00
Chinmay Deshmukh
e54cbe3165 Time/EN: "the week"
Summary: Make "the week" resolve to interval from `today` to `end of week`

Reviewed By: patapizza

Differential Revision: D15400571

fbshipit-source-id: 143fa2a8b7c30f1bee0ba8419926db90c680d036
2019-05-23 16:02:57 -07:00
Jens Persson
41f140992d Add support for larger spelled-out Danish ordinals (#346)
Summary:
Adds support for larger spelled-out Danish ordinal number expressions, like
treoghalvfemsindstyvende (93rd)
or
tohundrede og femogfyrrende (245th)
Pull Request resolved: https://github.com/facebook/duckling/pull/346

Reviewed By: patapizza

Differential Revision: D14476918

Pulled By: chinmay87

fbshipit-source-id: eb20ee8d304f291ff4ab2b28c4e272a9d447396e
2019-05-23 16:02:56 -07:00
Julien Odent
bf89e34365 Relicense to BSD3
Reviewed By: JoelMarcey

Differential Revision: D15439223

fbshipit-source-id: c5af3cb06318748142fe503945b38beffadfc28a
2019-05-22 10:46:39 -07:00
Kai Jun Weng
0eb5b060d7 Time/EN Add <duration> past <time>
Summary: We need to handle "N minutes past <time>".

Reviewed By: patapizza

Differential Revision: D15283767

fbshipit-source-id: 2a758e62c7af93b7f3c0e5856e38e3f040dcca03
2019-05-10 08:46:40 -07:00
Julien Odent
6d980a63a4 fix build
Summary: missing import

Reviewed By: haoxuany

Differential Revision: D15198265

fbshipit-source-id: 443c245c2194dd17b87fd5ae360e804f2b08142c
2019-05-03 09:26:50 -07:00
Noam Zilberstein
6cfa052b56 fix open source build
Summary: We need to specify the module name for the test module in the cabal file

Reviewed By: patapizza

Differential Revision: D15173223

fbshipit-source-id: 6dc5068c0d1e8fbae99b7ce9d96ae57a4f893490
2019-05-02 08:48:32 -07:00
Josua Blejeru
54cd64d0ec Fix minor issues in german. (#362)
Summary:
1. Fix a bug for "fünfter"
3. support for "am ersten Dezember" to " am einunddreißigsten Dezember"
3. duckling recognizes  "der fünfte Dezember"

- [x] ``README.md`` is up to date with docker
- [x] ``docker-compose.yml`` is included
- [x] all ``apt-get`` commands are in a single RUN command to avoid multiple stages
- [x] dockerfile now use the files from the directory
- [ ] more tests should be include
Pull Request resolved: https://github.com/facebook/duckling/pull/362

Reviewed By: patapizza

Differential Revision: D15100843

Pulled By: haoxuany

fbshipit-source-id: 407c8bb2a05a1d0cee81c407e81d882fca63a2be
2019-05-01 14:02:06 -07:00
Andrew Eun Kyu Kang
0b551597ce EN/Time: Add "<integer> <day-of-time> from <time>" rule
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
2019-04-29 18:16:58 -07:00
Chinmay Deshmukh
9962e25845 Time/EN: "<day> in <duration>" should only operate on grain > Hour
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
2019-04-24 11:46:35 -07:00
Noam Zilberstein
d6c9a0a95f add module header to TestMain.hs
Summary: Add a module header for more consistent style

Reviewed By: josefs

Differential Revision: D15046110

fbshipit-source-id: 0d6b03584da421c2a0cf4f5651077ee642cf08a3
2019-04-23 08:47:43 -07:00
Varun M Rao
10f3ce044f Time/EN: Krishna Janmashtami
Summary: Added Krishna Janmashtami to Duckling.

Reviewed By: chinmay87

Differential Revision: D14763094

fbshipit-source-id: 46d65c74f53010113ccfaab6cc0d40545c3945b9
2019-04-08 16:03:35 -07:00
Nathan Hausman
cbfca8ccc3 Support Arabic decimals and comma separated integers
Summary: Adding support for decimal numbers written in Arabic script.

Reviewed By: patapizza

Differential Revision: D14700060

fbshipit-source-id: 3261c36dde17dc9e589eac6b6521da6dece814f2
2019-04-03 13:07:23 -07:00
Nathan Hausman
f6399c8462 Support Arabic numeric integer and fractions
Summary: Adding support for Arabic numbers written in Arabic script.

Reviewed By: patapizza

Differential Revision: D14697405

fbshipit-source-id: 1162319afda55bdfdcb132932fa7e3a99fdcda15
2019-04-03 08:33:26 -07:00
Nathan Hausman
b90ff9a64e Support Arabic phone numbers
Summary: Support Arabic phone numbers for AR locales.

Reviewed By: patapizza

Differential Revision: D14591780

fbshipit-source-id: 93875c5b407c3fe2a06276c6fa3af2a26c91639e
2019-03-29 09:48:20 -07:00
Nathan Hausman
830e5e3d8e Time/AR: Periodic and Time
Summary: Adding Arabic support for periodic and rule computed holidays.

Reviewed By: patapizza

Differential Revision: D14573637

fbshipit-source-id: 84d8c42acaebc8483c641cc865e54c418c9918aa
2019-03-29 09:48:20 -07:00
Laurence Emms
77e88171d6 Extended support for Eid al-Adha from 1950 to 2000
Summary: Added dates for Eid al-Adha from Gregorian calendar years 1950 to 2000.

Reviewed By: patapizza

Differential Revision: D14492291

fbshipit-source-id: 7e5436ae2e5ded798753c29a0e94410a0d848dad
2019-03-25 11:33:17 -07:00
Tom Milligan
81c32e465a AmountOfMoney: match three letter currency codes beginning with C (#327)
Summary:
Closes #326

All three letter currency codes beginning with the letter `C` are missed by the `currencies` regex. The regex will match `c` (meaning `cents`) and return, so `CAD`, `CHF` and `CNY` will never be matched.

This PR adds tests for all three failing currencies, and corrects the regex.
Pull Request resolved: https://github.com/facebook/duckling/pull/327

Differential Revision: D14540169

Pulled By: patapizza

fbshipit-source-id: a909cb452cd9e9f00aa64d1c6458dcbc415f85b9
2019-03-20 08:46:59 -07:00
Hasan Eray Dogan
63195642de Added Guru Ravidass Jayanti
Summary: Added Guru Ravidass Jayanti

Reviewed By: chinmay87

Differential Revision: D14285746

fbshipit-source-id: fee9ebab8ae93d5f5960f3c9cc21765f426d80fa
2019-03-04 09:01:28 -08:00
Hasan Eray Dogan
165208742c Added Rabindra Jayanti holiday
Reviewed By: chinmay87

Differential Revision: D14197864

fbshipit-source-id: 663b511e19fb99a779d310b4433dcb809c838c57
2019-02-27 14:15:50 -08:00
Julien Odent
5e5f5b85e1 AmountOfMoney/EN: aborb a prefix
Summary: Fixes https://github.com/facebook/duckling/issues/340.

Reviewed By: haoxuany, girifb

Differential Revision: D14195058

fbshipit-source-id: a9341c245701b51202769bfe90d5a9284d0702a8
2019-02-25 11:16:31 -08:00
ilakli
25ff06c165 KA - Improvements in Time, Numeral, Duration (#299)
Summary:
- Improved understanding of past periods and dates which include days, months and years.
- Added support for quarters.
- Fixed unnecessary two or more results on some queries.
Pull Request resolved: https://github.com/facebook/duckling/pull/299

Differential Revision: D13878236

Pulled By: patapizza

fbshipit-source-id: 5ae4ac96dd5d75f54ed1567017a81e5a9c8bcc83
2019-02-22 18:16:32 -08:00
Maurice Doepke
2a90917ce4 Update dependencies to latest version to make duckling compile with ghc 8.6.3 (#334)
Summary:
I reviewed all outdated dependencies, there are 2 or 3 with minor breaking changes but none of them affect duckling.
Pull Request resolved: https://github.com/facebook/duckling/pull/334

Differential Revision: D14187742

Pulled By: patapizza

fbshipit-source-id: 301098d6ff1840e2715727a5d498f99d9ee3e037
2019-02-22 11:46:50 -08:00