Commit Graph

651 Commits

Author SHA1 Message Date
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
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
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
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
Karl Ostmo
a6b60c8921 support composite distances
Summary:
Add general support for composite distances and remove ad-hoc feet/inch-specific rules.
Test cases are added to the corpus.

This implementation resolves the ambiguous "m" unit to either Metric or Imperial units
based on context.

Reviewed By: patapizza

Differential Revision: D13911040

fbshipit-source-id: e75fd237158fc1c2f02709dfe4dd2f1907958b4c
2019-02-15 10:46:19 -08:00
Luciano van der Veekens
6d8a320a40 Time/NL Small bug fix (#314)
Summary:
In the NL time module there's this bug where the following input

_"het is voor 5 personen"_ (english: _"it's for 5 people"_)

extracts a _time_ entity from it, instead of the expected _number_ entity.

This PR aims to fix that problem.
Pull Request resolved: https://github.com/facebook/duckling/pull/314

Reviewed By: patapizza

Differential Revision: D13742641

Pulled By: chinmay87

fbshipit-source-id: 96abb3fef4b6e5b66d0fa179751e2636a7bb4605
2019-02-14 12:16:27 -08:00
Jens Persson
d85c7ee926 Add 'the day before yesterday' rule for German, and a test for it. Al… (#324)
Summary:
Add 'the day before yesterday' rule for German, and a test for it. Also another test
Pull Request resolved: https://github.com/facebook/duckling/pull/324

Reviewed By: patapizza

Differential Revision: D13931961

Pulled By: haoxuany

fbshipit-source-id: 11d9ebd879be3e4d28a762d5638ee300a4132445
2019-02-13 13:31:26 -08:00
Jens Persson
e176cd0195 fix veintodós spelling (#325)
Summary:
This seems to have existed earlier but have been removed. The correct spelling seems to be with the accent though.
Pull Request resolved: https://github.com/facebook/duckling/pull/325

Differential Revision: D14059697

Pulled By: patapizza

fbshipit-source-id: 7c2aafc555a31bff8962032613b8a1da0edc8dc9
2019-02-12 17:31:21 -08:00
akki2825
a2494caf61 add Kannada support (for Numeral)
Summary: Pull Request resolved: https://github.com/facebook/duckling/pull/322

Reviewed By: patapizza

Differential Revision: D13888983

Pulled By: haoxuany

fbshipit-source-id: b7a3b5c72dae0ccc637cf6faa14670ebf868bb50
2019-02-08 11:31:39 -08:00
Micha Molko
301f74ea2e AmountOfMoney/HE Extend support
Summary: Improve support for amount of money in Hebrew

Reviewed By: patapizza

Differential Revision: D13685915

fbshipit-source-id: f9796f52b4d011bdc5e1ef903d5e3dc789bfcd04
2019-02-06 02:32:24 -08:00
Nate Mueller
d31bf25bf4 Extend support for Mawlid from 1950 to 1998
Summary:
Dates based on the Umm al-Qura Calendar of Saudi Arabia.
http://www.staff.science.uu.nl/~gent0113/islam/ummalqura.htm
http://www.staff.science.uu.nl/~gent0113/islam/ummalqura_principal.htm

Reviewed By: chinmay87

Differential Revision: D13862563

fbshipit-source-id: 6085d4ede1553e7757e8d3cae67da4d0723400cd
2019-02-05 13:01:20 -08:00
VPanjeta
c30607851f HI Duration correction and synonyms addition (#319)
Summary:
Pakhwada (पखवाड़ा) is 15 days not a fortnight, corrected that logic and added new synonyms and rules for other time grains.
Pull Request resolved: https://github.com/facebook/duckling/pull/319

Reviewed By: chinmay87

Differential Revision: D13785950

Pulled By: girifb

fbshipit-source-id: 2e38ac2f1486ca8891ca561c0cb87141f5bfc1cd
2019-01-28 16:46:38 -08:00
Martin Ring
fc7f2c77dd DE: Distance + Volume
Summary: Pull Request resolved: https://github.com/facebook/duckling/pull/311

Reviewed By: patapizza

Differential Revision: D13683766

Pulled By: chinmay87

fbshipit-source-id: a18c5ab656d26eb2b83d9340f307baae89da56f6
2019-01-28 11:18:39 -08:00
Michele Riva
33b9d20a7a Added IT Rules and Corpus for Distance
Summary: Pull Request resolved: https://github.com/facebook/duckling/pull/307

Reviewed By: girifb

Differential Revision: D13606124

Pulled By: patapizza

fbshipit-source-id: 5c8718d4d7dea818d8d70117c2b0d799796ab33c
2019-01-23 10:31:00 -08:00
Hamza Kwisaba
392e584d1b swahili numerical support
Summary: Adding support for swahili numerals

Reviewed By: patapizza

Differential Revision: D13637092

fbshipit-source-id: 6fe0facfa74caae6fd00e0e84b09571aca616f21
2019-01-18 01:16:13 -08:00
Enzo Lebrun
a707be9eae Value before month in zh can be an integers or a chinese char (#301)
Summary:
May 2019 is more often written like' 2019年5月' than ' 2019年五月' so the corresponding integer are added in the regex's rule ruleMonths.
Pull Request resolved: https://github.com/facebook/duckling/pull/301

Reviewed By: haoxuany

Differential Revision: D13606127

Pulled By: patapizza

fbshipit-source-id: 7dd2536e36711b4be42a93419b08dbd66cf31523
2019-01-14 09:45:56 -08:00
Yarik Markov
7d6af43feb Remove the list of exposed exports from Time.En.Us.Rules
Summary: This will allow other modules to import the defined Time rules without redefining it.

Reviewed By: patapizza

Differential Revision: D13613596

fbshipit-source-id: d4232ef3860680de8448f0ad6d586519ba1f2215
2019-01-10 14:15:59 -08:00
Alon Elishkov Harel
2b2af2eb95 Time/NL: Added suport for king's day
Summary: Implemented a rule for king's day (Koningsdag)

Reviewed By: haoxuany

Differential Revision: D13545471

fbshipit-source-id: f43116b14fd8649896941bed23c528d0a39a5881
2019-01-08 23:45:56 -08:00
Eelco den Heijer
f3088ae252 Added Quantity for NL, small fix for Volume NL (#302)
Summary:
* Added Quantity for NL (kg, mg, g, cup)
* Small fix for Volume (removed Gallon, fixed 'milliliter' typo)
Pull Request resolved: https://github.com/facebook/duckling/pull/302

Reviewed By: chinmay87

Differential Revision: D13554637

Pulled By: patapizza

fbshipit-source-id: 445fcb062c8cc2643b8e7810722759c168b5242f
2019-01-02 14:01:54 -08:00
Wojtek Przechodzeń
e662269626 Time/PL add today evening corpus example (#294)
Summary:
I'm using Duckling on a daily basis for Polish but there is a problem with some time synonyms. I've tried to add some ([#293](https://github.com/facebook/duckling/pull/293)) but unfortunately I couldn't add 'wieczorem' word wich is polish equivalent to `evening`.
Can you give me some tip how I can implement it or just implement that missing synonym?

Thanks for that great tool!
Pull Request resolved: https://github.com/facebook/duckling/pull/294

Reviewed By: chinmay87

Differential Revision: D13554490

Pulled By: patapizza

fbshipit-source-id: 013e3eccc96b44fd3f659c029b7a0542783b0b2c
2019-01-02 14:01:54 -08:00
João Gonçalves
23737375d9 Time/PT: Last and quarter expressions + ordinals 13..99 (#291)
Summary:
Add support for ordinals from 13..99
Add support for quarter expressions like:

- próximo trimestre

- quarto trimestre de 2018

- último trimestre de 2015

- de primeiro trimestre de 2017 até terceiro trimestre de 2017

- entre terceiro mês de 2017 e nono mês de 2017

Add new vocabulary for last expressions like:

- últimos 2 meses

- 2 meses anteriores
Pull Request resolved: https://github.com/facebook/duckling/pull/291

Reviewed By: chinmay87

Differential Revision: D13553884

Pulled By: patapizza

fbshipit-source-id: 330af62bf457ffaab65636b29fb7bb51ba8a3ae5
2019-01-02 14:01:53 -08:00
Michele Riva
9a45a0cf7b Added IT Rules and Corpus for AmountOfMoney (#284)
Summary:
Hi,
I've added Rules and Corpus for Italian language on "AmountOfMoney".
Running `stack test`, I always get `empty result on "10 000 dollari"`.
I've checked my code more than once but I can't figure out what is not working. I made a PR in order to make it easier for you to understand what's going wrong :)

I really hope that my contribution can help.
Regards!
Pull Request resolved: https://github.com/facebook/duckling/pull/284

Reviewed By: chinmay87

Differential Revision: D13551890

Pulled By: patapizza

fbshipit-source-id: c1b448e44c2c6720ad93f61c6396f4d75231131e
2019-01-02 14:01:53 -08:00
Martin Heuschober
c0e4c8c926 fix issue #249 (wrong parsing of yyyy-mm-dd dates in DE) (#282)
Summary:
- took regex from EN (which is working)
- added test cases from 2016-01-01 to 2018-12-31

- change non-breaking space to regular space
Pull Request resolved: https://github.com/facebook/duckling/pull/282

Reviewed By: chinmay87

Differential Revision: D13551882

Pulled By: patapizza

fbshipit-source-id: e254be1beaed21226741c55f243ac21eaa06d636
2019-01-02 14:01:53 -08:00
Yarik Markov
0093590968 Remove the list of exposed exports from Time.En.Rules
Summary: This will allow other modules to import the defined Time rules without redefining it.

Reviewed By: patapizza

Differential Revision: D13320380

fbshipit-source-id: e6fc7214e282de279974e14ad01e9c5b9c8c0986
2018-12-04 14:01:04 -08:00
Santosh Kumar Ghosh
d2705eccfb Add Dayananda Saraswati Jayanti holiday
Summary: Added suppport for Dayananda Saraswati Jayanti 2000-2030

Reviewed By: patapizza

Differential Revision: D13267610

fbshipit-source-id: 58e1415235ecd1814fb719ff5a547a75f67a3b6e
2018-12-01 10:16:07 -08:00
uugan
69ffb0f39d Mongolian (#277)
Summary:
MN Setup+Numeral
Pull Request resolved: https://github.com/facebook/duckling/pull/277

Reviewed By: chinmay87

Differential Revision: D13028169

Pulled By: patapizza

fbshipit-source-id: 7d587300918b3ed6211b6ce4147350147b4dc89e
2018-11-26 15:31:08 -08:00
Giovanni Cappellotto
97cbde5454 Handle credit card dashes
Summary: This update adds support for credit card numbers that contain dashes, at least for the issuer specific regular expressions.

Reviewed By: patapizza

Differential Revision: D13105871

fbshipit-source-id: 36130d2c7c53efc837ff61d7037761987660901c
2018-11-19 06:15:53 -08:00
Vitaly Shaydurov
b40e2147a9 Time/UK: added dimensions
Summary:
- added Time dimension for UK language
- added tests for Time dimension for UK language

Reviewed By: patapizza

Differential Revision: D13024050

fbshipit-source-id: e5be933fff8041c42d8fd26ddaf919584912a012
2018-11-19 04:31:03 -08:00
Vitaly Shaydurov
3c5790f605 TimeGrain,Duration/UK: added dimensions
Summary:
- added TimeGrain dimension for UK language
- added Duration dimension for UK language

Reviewed By: patapizza

Differential Revision: D12871569

fbshipit-source-id: 356c2031aa9582620be11ea634c854c0d96ebbeb
2018-11-19 04:31:03 -08:00
Jeremy L. Morris
4bee26851e Update rules to allow more variation for MonthDDDD intervals. (#271)
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
2018-11-17 00:45:55 -08:00
Giovanni Cappellotto
39a6a4c6ec Add missing pattern match
Summary:
`fromName` was missing a pattern to match the new `"credit-card-number"` dimension string representation.

Adding also `CreditCardNumber.Tests.tests` to the `Dimensions Tests` test group.

Reviewed By: chinmay87

Differential Revision: D13072125

fbshipit-source-id: 792727ef038d26ae12ceea909fa726692d56db6d
2018-11-15 07:16:57 -08:00
Hyo Jin Kim
5de0b1fbb6 Support intervals
Summary: Support intervals for Duckling AmountOfMoney KO

Reviewed By: haoxuany

Differential Revision: D13020692

fbshipit-source-id: 79e1d99acf317467c1b06b156f47a497c91062da
2018-11-14 14:30:51 -08:00
Giovanni Cappellotto
1052914cb4 Credit cards
Summary:
Add the ability to parse credit cards and identify the issuer in Duckling.

Credit card numbers are a sequence of 8 to 19 digits, with a few specific digits at the start that identify the card issuer. They also satisfy Luhn checksum (https://en.wikipedia.org/wiki/Luhn_algorithm).

Reviewed By: chinmay87

Differential Revision: D13014623

fbshipit-source-id: 96586e074777ae90a4a39c515648c31a8111f0c2
2018-11-14 11:16:03 -08:00
riccardo.macioce
4c4e0c59b7 Time/IT: wrong results for the ruleDurationAgo rule for the Italian language (#279)
Summary:
Fixes #278
Pull Request resolved: https://github.com/facebook/duckling/pull/279

Differential Revision: D13044464

Pulled By: patapizza

fbshipit-source-id: f4534fda4def6fa590786320fbcbe88d475d0e9e
2018-11-13 14:01:26 -08:00
Julien Odent
d0516324ec Time/VI: don't parse ngày
Summary:
Fixes https://github.com/facebook/duckling/issues/273.
`ngày` can mean day or date in Vietnamese.
Fixed bad Christmas regex.

Reviewed By: chinmay87

Differential Revision: D12955229

fbshipit-source-id: 071b623e581d36f7db4bf356219647147a087a25
2018-11-07 09:45:53 -08:00
Kumar Shridhar
975489fed6 Added German+Icelandic spelled out Email
Summary: Pull Request resolved: https://github.com/facebook/duckling/pull/272

Reviewed By: chinmay87

Differential Revision: D12955290

Pulled By: patapizza

fbshipit-source-id: 671ee50c92c031762aa147dc6bd98f374693ba6b
2018-11-07 09:15:53 -08:00
PhalPheaktra Chhaya
3374f4ea50 Add Volume/KM and Distance/KM (#256)
Summary:
Hello.
I have updated Quantity/KM and added 3 more dimensions (Volume/KM, Time/KM, and Distance/KM) for KM.
Please take a look at it.
Pull Request resolved: https://github.com/facebook/duckling/pull/256

Reviewed By: patapizza

Differential Revision: D9758093

Pulled By: xhavokx

fbshipit-source-id: 5a800fd443789795b8e63c88dade3785cfca706c
2018-10-31 16:45:58 -07:00
Krogsager
d90cf205db Recognize time from abbreviation 'kl' (#267)
Summary:
The common phrase "i dag kl 15" (today at 15:00) will now be recognized with the correct time.
So far duckling has expected the 'kl' to be written as 'kl.'.

Before this pull
`$ curl -XPOST http://0.0.0.0:8000/parse --data 'locale=da_DK&text=i dag kl 15'`
Time is 00:00:00:
```
[{"body":"i dag","start":0,"value":{"values":[{"value":"2018-10-18T00:00:00.000-07:00","grain":"day","type":"value"}],
	**"value":"2018-10-18T00:00:00.000-07:00",**
"grain":"day","type":"value"},"end":5,"dim":"time","latent":false},{"body":"15","start":9,"value":{"value":15,"type":"value"},"end":11,"dim":"number","latent":false}]
```

`$ curl -XPOST http://0.0.0.0:8000/parse --data 'locale=da_DK&text=i dag kl. 15'`
Time is 15:00:00:
```
[{"body":"i dag kl. 15","start":0,"value":{"values":[{"value":"2018-10-18T15:00:00.000-07:00","grain":"hour","type":"value"}],
	"value":"2018-10-18T15:00:00.000-07:00",
"grain":"hour","type":"value"},"end":12,"dim":"time","latent":false}]
```

After this pull:
`$ curl -XPOST http://0.0.0.0:8000/parse --data 'locale=da_DK&text=i dag kl 15'`
Time is 15:00:00
```
[{"body":"i dag kl 15","start":0,"value":{"values":[{"value":"2018-10-18T15:00:00.000-07:00","grain":"hour","type":"value"}],
	"value":"2018-10-18T15:00:00.000-07:00",
"grain":"hour","type":"value"},"end":11,"dim":"time","latent":false}]
```
Pull Request resolved: https://github.com/facebook/duckling/pull/267

Reviewed By: chinmay87

Differential Revision: D10489441

Pulled By: patapizza

fbshipit-source-id: ae574a7057be3adbb29ee1cb0659d4e5afa896e8
2018-10-22 13:46:56 -07:00
Chinmay Deshmukh
9077f9e147 AmountOfMoney,Numeral/EN: Add support for lakh and crore
Summary:
Add support for lakh (1e5) and crore (1e7) in Numeral.

This will help resolve "9-7 lakh rupees" to (Rs. 9, Rs. 700000). Next step is to resolve it to (Rs. 900000, Rs. 700000)

Reviewed By: patapizza

Differential Revision: D10417678

fbshipit-source-id: 670115f22015698ff8c7a9d96afd624efd4c864e
2018-10-17 10:30:50 -07:00
Colin Clemmons
ea1ed47336 Time/EN: Adds Support for Parsi New Year
Summary: Adds support for Parsi New Year

Reviewed By: patapizza

Differential Revision: D10208163

fbshipit-source-id: 6c125ab4310cb81c239d9a2ee3c765a4a1841a5c
2018-10-16 13:16:52 -07:00
Makan Diarra
4943798c75 Extend support for Ramadan and Eid al-Fitr from 2029 to 2050
Summary: Extended Ramadan and Eid al-Fitr from 2029 to 2050 in computed.hs

Reviewed By: chinmay87

Differential Revision: D10304284

fbshipit-source-id: 5240046977632411bf067769499e6afbcda0af7b
2018-10-12 10:01:09 -07:00
Egxona Ferati
f2fd05f9c2 Add Guru Gobind Singh Jayanti holiday
Summary: Adding support for Guru Gobind Singh Jayanti holiday from 2000 to 2030.

Reviewed By: chinmay87

Differential Revision: D10148514

fbshipit-source-id: 79e35bcca37f7a87fc6b46fda41edf0a57b424a6
2018-10-03 15:30:52 -07:00
Akhil Ravidas
e349942541 Support malayalam ordinals
Summary: Add support for malayalam ordinals.

Reviewed By: patapizza

Differential Revision: D10097075

fbshipit-source-id: 90be5f05d1f9cf4cc6558a4583c8c72518fe0ab0
2018-09-28 10:30:54 -07:00
Akhil Ravidas
c46dbb0d92 Support malayalam numerals
Summary: Add support for malayalam numerals in duckling.

Reviewed By: patapizza

Differential Revision: D10075358

fbshipit-source-id: ce7fee2a71d862391980481b018c513981249f3d
2018-09-28 10:30:54 -07:00
Konstantin Kloster
ee24a4196d small bugfix in german numeral dimension (#257)
Summary:
There is a small bug in the German numeral dimension. The number "fünfzehn"(15) cannot be recognized correctly due to a typo. This pull request should fix it:)
Pull Request resolved: https://github.com/facebook/duckling/pull/257

Reviewed By: girifb

Differential Revision: D9810012

Pulled By: patapizza

fbshipit-source-id: e2408a2dc237590b24840260e2a97e9b5c8231f3
2018-09-13 14:30:44 -07:00
Albert Morgese
2ace5d474b AmountOfMoney/EN: Add basic latent support
Summary: Implemented basic latent value support for AmountOfMoney (along with a corpus).  Currently only supports raw numbers.

Reviewed By: chinmay87

Differential Revision: D9777183

fbshipit-source-id: 16a454d451b74ddc526e0db1ddc9b4959b677ca6
2018-09-12 15:30:58 -07:00
Michelle Prawiro
5d8fb7e7fe AmountOfMoney/ID: Support intervals
Summary: Adding interval support for `AmountOfMoney` in Indonesian.

Reviewed By: adanielescu

Differential Revision: D9416842

fbshipit-source-id: 13f1ed74e6ef1e5c12a2f5d785e44069eefe555b
2018-09-07 10:45:45 -07:00
jfulse
d5639056f3 Norwegian currencies (#244)
Summary:
Some small improvements to Norwegian currencies:

- Parse more currencies. Some were not yet defined in `AmountOfMoney.Types` and thus were added
- Parse `norske kroner` as well as `kroner`
- Parse cents of more currencies
- Remove duplicate rule `ruleIntersectXCentsWithAnd` (duplicated in `ruleIntersectAndXCents`)
Pull Request resolved: https://github.com/facebook/duckling/pull/244

Reviewed By: patapizza

Differential Revision: D9505839

Pulled By: haoxuany

fbshipit-source-id: 69c777a24e5138c04f3ada56c5d8541c9837bb8c
2018-09-06 21:00:57 -07:00
pheaktra21
cd33b26acf Add support for Ordinal, Quantity, & Temperature dimension for KM. (#251)
Summary:
Hello.
I added 3 new dimensions: Ordinal, Quantity, & Temperature. And I also added more data to Numeral dimension.
Thank you!
Pull Request resolved: https://github.com/facebook/duckling/pull/251

Reviewed By: beauby

Differential Revision: D9656646

Pulled By: patapizza

fbshipit-source-id: f17797be811d58b0b5bcd02b83c0a699650c9f6e
2018-09-06 07:01:15 -07:00
kumar-shridhar
4a77765134 Icelandic support
Summary: Pull Request resolved: https://github.com/facebook/duckling/pull/247

Reviewed By: beauby

Differential Revision: D9656660

Pulled By: patapizza

fbshipit-source-id: 993baa9a0e442fc6f6f813a3af717b700c4d89e6
2018-09-06 06:46:02 -07:00
jfulse
b9d39f723e Norwegian numeral improvements (#243)
Summary:
Some small improvements to Norwegian numerals:

- Parse powers of ten with spaces as well as dots: `10 000 == 10.000`
- Some more textual powers of ten: `milliard`, `billion`, ...
- Textual numbers from 21 to 99: `tjueen`, `tjueto`, ...
   (they were already parsed with spaces, as in `tjue en`, but not without)
Pull Request resolved: https://github.com/facebook/duckling/pull/243

Reviewed By: patapizza

Differential Revision: D9505835

Pulled By: haoxuany

fbshipit-source-id: e42a290b3dd2d5e6a82f00514617b4c3c4dd3416
2018-08-31 17:46:08 -07:00
David Magaltadze
ab3b789896 KA AmountOfMoney (#245)
Summary:
Added support for AmountOfMoney for KA
Pull Request resolved: https://github.com/facebook/duckling/pull/245

Differential Revision: D9510854

Pulled By: patapizza

fbshipit-source-id: 966c0f69193dd37ed458339fbc381ca640a3a179
2018-08-28 17:00:50 -07:00
Julien Odent
fd3948169f Time/EN: Intersect "9 tomorrow morning"
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
2018-08-28 16:45:45 -07:00
Nathan Hu
eb0b84a5aa Time/EN: add <datetime> - <datetime> (interval) timezone rule
Summary: Introducing `hasTimezone` flag to prevent double timezone parsing.

Reviewed By: patapizza

Differential Revision: D9317892

fbshipit-source-id: 0e9246abeb65c5fa61725f9b78a1421d85263bdc
2018-08-24 11:45:45 -07:00
Nihar Shah
6a05e40a37 Volume: Intervals Support
Summary:
This diff implements volume intervals in Duckling. It follows the AmountofMoney and Quantity modules in doing so.

I had to make one crucial choice here -- defining the core Volume data type -- and whether the attribute "Unit" was optional (i.e. "Maybe") or not. Like in Quantity and unlike in AmountOfMoney, I made it optional, so that latent volumes can be supported down the line in the codebase.

I also wrote the codebase to be more modular, such that future developers only need to add regular expressions rather than functions for any language. For instance, developers can simply define a fraction (e.g. "eighth") at the start of the file, and new rules will be generated automatically; rather than requiring the developer to create an entirely new rule, as previously. The only (partial) exceptions were in the Arabic and Russian Rules files, where the language structure is more difficult and so I cannot fully implement this. Developers for those two languages may need to write new rules, as before.

Reviewed By: patapizza

Differential Revision: D9043117

fbshipit-source-id: f08de4f167596b5b32d12a79268b8ab92c099b22
2018-08-24 11:31:08 -07:00
Kay Hu
fc801ad600 Time/EN: Holiday name alias fixes
Summary:
Adding holiday aliases:
Veteran Day
Mardi Gras
St. Paddy's Day

Reviewed By: chinmay87

Differential Revision: D9483120

fbshipit-source-id: 50bf8338bbaf5c4a59210331dac00508141be1ee
2018-08-23 17:45:42 -07:00
David Magaltadze
010146d2f4 GE + Duration, Ordinal, TimeGrain, Time (#221)
Summary:
Added initial support for ka_GE for

- Duration
- Ordinal
- TimeGrain
- Time
Pull Request resolved: https://github.com/facebook/duckling/pull/221

Differential Revision: D8840919

Pulled By: haoxuany

fbshipit-source-id: 80f94fbaf25786b0f58cd6598c29cd3663858809
2018-08-22 18:30:48 -07:00
Chinmay Deshmukh
dd60c1e013 Time/EN: in <duration> at <time-of-day>
Summary: Make rule for in <duration> at <time-of-day>

Reviewed By: patapizza

Differential Revision: D9375588

fbshipit-source-id: e0ebea53005b09e0ef8b70bf4f68d73b0f75df08
2018-08-20 00:30:52 -07:00
Gerben Janssen van Doorn
f70f991b38 Added support Lao numerals
Summary: Duckling didn't support Lao numerals, this diff adds it.

Reviewed By: patapizza

Differential Revision: D9323242

fbshipit-source-id: 5dad0d4dfb4843281a327947690e664c91ab8f1a
2018-08-17 10:31:17 -07:00
Daniel Sainati
3910c68262 AmountOfMoney/EN: added support for subunits of dollars
Summary: Added support for recognizing nickels, dimes and quarters, as well as numbers of coins.

Reviewed By: patapizza

Differential Revision: D9317706

fbshipit-source-id: 3fb3d63546c9cfe13c094703ddb583c6ac46585b
2018-08-16 15:45:43 -07:00
Christian Johns
84a4f30f5a Flip month-match expressions in VI ng(à)y regex (#228)
Summary:
Fix issues where date time matching on double-digit months fails for VI.

Reverse the order of month digit matching in two VI rules. Reversing will attempt to capture a two digit month beginning with 1, then fall back to single digit months optionally preceeded with a 0.

The current regex greedily captures months starting with 1, but only of a single digit. (10, 11, and 12) are left out of this calculation, and thus regexes for capturing ng(à)y fail. This leads us into bad capturing on unexpected rules. When matched properly, the idea rules for matching date times are used.

Resolves #225.

I've added to the VI Time Corpus the case in question in #225 and verified its failure at `master` and success on this branch.
Pull Request resolved: https://github.com/facebook/duckling/pull/228

Reviewed By: chinmay87

Differential Revision: D9303795

Pulled By: patapizza

fbshipit-source-id: aa114f886ab0fdcd95f87730d36e5a686afe2f9c
2018-08-16 13:31:07 -07:00
Julien Odent
546fa113a6 Time: Add "today" helper + reuse "tt" helper
Summary: Instead of `cycleNth TG.Day 0` and `Just . Token Time`.

Reviewed By: chinmay87

Differential Revision: D9344258

fbshipit-source-id: 1731c19f0d83640c5716757c70fcefea4655172f
2018-08-15 12:45:48 -07:00
Julien Odent
a3e87589a1 Time: Reuse "now" helper
Summary: Instead of `cycleNth TG.Second 0`.

Reviewed By: chinmay87

Differential Revision: D9341237

fbshipit-source-id: 153dba6edb0b341afad1ee6f7fa04361415be211
2018-08-15 12:45:48 -07:00
Julien Odent
7fba0f0f28 Time: Fix some intervals for time-of-days
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
2018-08-15 12:45:48 -07:00
Julien Odent
53d124ffe8 Time/EN: make upper interval consistent for durations
Summary:
Upper interval bounds should be exclusive. For consistency, fixing this in a few rules related to durations.

https://github.com/facebook/duckling/issues/230
https://github.com/wit-ai/node-wit/issues/178

Reviewed By: chinmay87

Differential Revision: D9332993

fbshipit-source-id: ceddb193c019602c714fceb155baf4c56b77572d
2018-08-15 12:45:48 -07:00
Chinmay Deshmukh
179cec14fb Time/EN Support "Martin Luther Kings Day"
Summary: Expand regex to support "Martin Luther Kings Day"

Reviewed By: patapizza

Differential Revision: D9329681

fbshipit-source-id: 78d184f47daef582b21f5c9511b1972c762c27bc
2018-08-15 12:31:30 -07:00
Julien Odent
af480b80f0 Time/EN: Add Purim and Shushan Purim (Jewish holidays)
Summary:
Following other Jewish holidays convention, starting on sunset of
previous day.

Reviewed By: chinmay87

Differential Revision: D9315490

fbshipit-source-id: bdfef5ba0c7bca6601bb7557d30840b47734b819
2018-08-15 12:01:07 -07:00
Julien Odent
e818b4ce9e Time/EN: Restrict "on" absorption to days
Summary:
We were absorbing "on" followed by any Time token.
Restricting to days of weeks and days of months only.

https://github.com/facebook/duckling/issues/217

Reviewed By: chinmay87

Differential Revision: D9313306

fbshipit-source-id: a0c33658855af8f69631d4d1879cc27062c26a69
2018-08-15 01:16:12 -07:00
Sophia Zheng
3c6d3b38db Add daylight saving start and end times.
Summary:
Added "holidays" for daylight savings start and end dates.
In U.S., Daylight Saving start day is the second Sunday in March,  end day is the first Sunday in November.

Reviewed By: chinmay87

Differential Revision: D9277160

fbshipit-source-id: 71038d42d14c4a241cfbaf9ac4499c44139d2ba6
2018-08-14 11:45:55 -07:00
Julien Odent
b45e1c09f9 Time/EN: Allow for "Chinese New Years"
Summary: as titled

Reviewed By: chinmay87

Differential Revision: D9295927

fbshipit-source-id: d90f5183c0b4d7b483f5cf1bf8957f514954944c
2018-08-14 01:31:13 -07:00
Daniel Sainati
3de16f3fae added support for Vaisakhi 2000-2030
Summary: Added support for Vaisakhi holiday

Reviewed By: chinmay87

Differential Revision: D9275656

fbshipit-source-id: 21744a93c191837e990ddd381ea46eb7f85b86cf
2018-08-10 15:15:51 -07:00
PhalPheaktra Chhaya
b541354c31 Add Numeral dimension for new language KM. (#234)
Summary:
Hello,
I am new to Haskell, but I would like to add Khmer language (KM) to Duckling.
I have tried to extended Duckling by adding Numeral dimension for new language KM.
Please have a look at it and see what we can improve.

Thanks!
Pull Request resolved: https://github.com/facebook/duckling/pull/234

Reviewed By: blandinw

Differential Revision: D9032639

Pulled By: chinmay87

fbshipit-source-id: 7db19edf732fe6500629cc89e18e0655d7bbc48b
2018-08-03 14:45:55 -07:00
Nathan Hu
945154a174 add (timezone) rule
Summary:
add rule to match
<time> + (timezone)
It needs to be a seperate rule from the existing ruleTimezone because we need to make sure a match on both "(" and ")" before and after the timezone string.

if I do regex "(\b|\()XXX(\b|\))" it can't guarantee the match on both.

Reviewed By: xhavokx

Differential Revision: D9143475

fbshipit-source-id: bda686763c3cf69b9e2096ce05878ba592076814
2018-08-03 12:01:03 -07:00
Ben Powell
984769244f Time/EN: All week, Rest of the week
Summary:
Task also says to add "this week", but this is already covered
by the "this <time>" rule.

Reviewed By: chinmay87

Differential Revision: D9018849

fbshipit-source-id: 210daf87ad4221cf734f260932f7c95c8a3e417a
2018-08-01 09:45:42 -07:00
Chinmay Deshmukh
9a4bb48c63 Time: Fix BST and IST offsets
Summary:
Fix the offsets for BST and IST timezones.
BST is +1 (60) and IST is +5:30 (330)

Reviewed By: girifb

Differential Revision: D8981055

fbshipit-source-id: 43ad669c22638031479a7608a8e651b178361c0d
2018-07-25 13:15:50 -07:00
jfulse
e1088c1856 Norwegian improvements (#232)
Summary:
Some small improvements to the Norwegian implementation:

- The written number 8 had a typo: "otte" -> "åtte"
- Add support for half an hour before as e.g. "halv to"
- Add support for alternative clock denotation "klokka"
- Add support for alternative tomorrow denotation "i morra"
Pull Request resolved: https://github.com/facebook/duckling/pull/232

Reviewed By: girifb

Differential Revision: D8986441

Pulled By: chinmay87

fbshipit-source-id: 286617d30415febe1f0eda4bc7475ca5c9610734
2018-07-25 13:15:50 -07:00
Nathan Hu
8e658b2e27 add rules to time
Summary:
this rule can parse time interval like this:
2015-03-28 17:00:00/2015-03-28 21:00:00

Need to check both timeData has the same Grain to avoid ambiguity like the following:

intersect (2015-03-28 17:00:00/2015-03-28 21:00:00)
-- <datetime>/<datetime> (interval) (2015-03-28 17:00:00/2015-03-28)
-- -- intersect (2015-03-28 17:00:00)
-- -- -- yyyy-mm-dd (2015-03-28)
-- -- -- -- regex (2015-03-28)
-- -- -- hh:mm:ss (17:00:00)
-- -- -- -- regex (17:00:00)
-- -- regex (/)
-- -- yyyy-mm-dd (2015-03-28)
-- -- -- regex (2015-03-28)
-- hh:mm:ss (21:00:00)
-- -- regex (21:00:00)

Reviewed By: xhavokx

Differential Revision: D8951108

fbshipit-source-id: 5d5084c8c7e8d9420b9899ccbb8d757a0322be00
2018-07-23 12:31:49 -07:00
Yujiao Zhou
20c8a3750d parse yyyy-mm
Summary: as titled.

Reviewed By: haoxuany

Differential Revision: D8895617

fbshipit-source-id: 2c0ccdcbb39945d836bd64f5ff9d790c8f636b79
2018-07-20 10:30:46 -07:00
Nathan Hu
98463ae14d update typeclass to make cast work.
Summary: update typeclass to make cast work.

Reviewed By: watashi

Differential Revision: D8918769

fbshipit-source-id: af44737d439d8748926114ca7ff606fcda848946
2018-07-19 12:01:42 -07:00
Nivin Lawrence
e279c5642e added tamil ordinal
Summary: support tamil ordinal

Reviewed By: girifb

Differential Revision: D8713963

fbshipit-source-id: c0760f0cf13d983473d29e18425ba926584c3072
2018-07-16 17:15:53 -07:00
Julien Odent
9c367ab6cd Don't accept dashes (-) as token separators
Summary:
This is causing some issues, e.g. `20-30` resolving to 8:30pm (latent).
Updating `Numeral` rules to account for that (`EN`, `FR`, `NL` following tests).

Differential Revision: D8854891

fbshipit-source-id: ba17099b014d9cf2f48a7d85147cc890b02578f5
2018-07-16 06:00:40 -07:00
Arunavha Chanda
d5555d0149 Numeral/BN: Adding Bengali numeral support to Duckling
Summary: Added support for Bengali numerals

Reviewed By: patapizza

Differential Revision: D8730468

fbshipit-source-id: dc36017e24d796f35abc477a0b8b317218c64a6a
2018-07-09 12:30:30 -07:00
Cuong Dinh Tri Nguyen
4e11613d39 Supported AmountOfMoney intervals and improved Numeral
Summary:
Support amount of money intervals for VI

Modify ruleNg, ruleDollar, and ruleVND to better capture the usage of VI

In Numeral, add "ngàn" - a common synonym of "nghìn", and "chục" - colloquially used to count tens. Remove "?" in regex of other words as it does not make sense.

Reviewed By: haoxuany

Differential Revision: D8734066

fbshipit-source-id: 15f879ab796025882c85f0ce9f1677c501b364a0
2018-07-09 10:00:42 -07:00
Nathan Hu
9d757ea449 new rule to handle 13/APR/2018
Summary:
Adding new rule to support:
"31/Oct/1974"
"31st Oct 1974"

Reviewed By: patapizza

Differential Revision: D8752684

fbshipit-source-id: 06b29ffde0d41a6133489a882dc3259570fe6a5c
2018-07-06 14:46:03 -07:00
Tiago Baptista
11e43c0775 Time/EN: Add support to YYYYQQ and YYQQ expressions (#219)
Summary:
Add support to expressions like:
- 2018Q4
- 18Q4
Closes https://github.com/facebook/duckling/pull/219

Reviewed By: haoxuany

Differential Revision: D8713864

Pulled By: patapizza

fbshipit-source-id: 491dfd408c6c2d6afdb1d70f738f87af0456bf40
2018-07-02 15:15:38 -07:00
Julien Odent
f5bd1efb4a Time/EN: fix Palm Sunday regex
Summary:
* Fixes https://github.com/facebook/duckling/issues/215.
* `regenLangClassifiers` helper

Reviewed By: chinmay87

Differential Revision: D8663109

fbshipit-source-id: 5cbbc05729caabadeb0a88190ce00312174a4fdb
2018-06-27 12:30:42 -07:00
Julien Odent
ead526a820 Time/FR: fix month intervals
Summary:
* Fixes https://github.com/facebook/duckling/issues/213
* Updated month interval rules to handle ordinals and spelled out numerals (e.g. "du premier au quinze juin")

Reviewed By: l5t

Differential Revision: D8615867

fbshipit-source-id: fac7c4aa14e175bc3f9cc7c672008a6bc6063055
2018-06-26 11:45:42 -07:00
Tero Laxström
4ed1ed83ed Basics for Finnish (#210)
Summary:
Adds Locale and Numeral for Finnish
Closes https://github.com/facebook/duckling/pull/210

Reviewed By: JonCoens

Differential Revision: D8430386

Pulled By: patapizza

fbshipit-source-id: a3c8b3b3419b7f43e2ef332cdb1fb8fc07da3bec
2018-06-19 10:45:27 -07:00
David Magaltadze
713e5db9d6 Added support of Numeral for ka_GE (#211)
Summary:
* `ka_GE` locale
* full support for Numeral
Closes https://github.com/facebook/duckling/pull/211

Reviewed By: chinmay87

Differential Revision: D8456241

Pulled By: patapizza

fbshipit-source-id: 35fb432191bd20a4965503efde94c5ea29d0c50d
2018-06-18 13:31:14 -07:00
Lucas Pasqualin
7d469a2f85 adds support for during month and regenerates classifiers (#208)
Summary:
Adds support for catching `during <month>`.

Wasn't sure whether or not to commit the classifiers, let me know if I got this right :)

Thanks!
Closes https://github.com/facebook/duckling/pull/208

Reviewed By: chinmay87

Differential Revision: D8427153

Pulled By: patapizza

fbshipit-source-id: 72c9567939cd0eeab62870e48d6e084cfe290bf1
2018-06-14 13:15:42 -07:00
Anshuman Chhabra
5ab49060e1 Added Temperature support for Hindi (HI) language (#206)
Summary:
This PR adds Temperature dimension support for Hindi (HI). Let me know if there are any changes to be made :)

Cheers!
Closes https://github.com/facebook/duckling/pull/206

Reviewed By: haoxuany

Differential Revision: D8381472

Pulled By: patapizza

fbshipit-source-id: a085ba73910a80a51385f01475d9ba75f72fd4c5
2018-06-13 17:00:35 -07:00
Julien Odent
c7bef34bc2 Duration/EN: Fix composite durations without delimiters
Summary: It would only work with commas/and-separated tokens.

Reviewed By: JonCoens

Differential Revision: D8381351

fbshipit-source-id: eafceeaf5d41bf60aaaf78c3bd6835a768e2b0b6
2018-06-12 10:45:42 -07:00
Julien Odent
9558b7a766 Time/EN: Fix 'ten thirty' latent
Summary:
* fix latent time of days like "ten thirty"
* don't parse time of days above 12 with meridiem like "13 am"

Reviewed By: haoxuany

Differential Revision: D8363720

fbshipit-source-id: 8236babdd5b8ab4163ad39704a295be048d1b03e
2018-06-11 14:00:26 -07:00
Julien Odent
e8286f762c Numeral/RO: Fix multipliers with values above 20
Summary: In Romanian, for numerals above 20, we say "20 de milioane", not "20 milioane".

Reviewed By: haoxuany

Differential Revision: D8334109

fbshipit-source-id: a7fc83440334ab9b1f0511f315029e28449f9771
2018-06-11 11:00:38 -07:00
Julien Odent
3d23372913 Volume/RO: Fix for values above 20
Summary:
In Romanian, for numerals above 20, we say "20 de litri", not "20 litri".
This would actually allow things like "4 de litri", though it's fine as it
doesn't alter meaning.

Differential Revision: D8332996

fbshipit-source-id: 709a97cec3c09513281be19e1a9b20895874b9c4
2018-06-08 09:45:28 -07:00
Julien Odent
f705206fb2 Temperature/RO: Fix for values above 20
Summary:
In Romanian, for numerals above 20, we say "20 de grade", not "20 grade".
Here we optimize for recall and allow "20 de grade de celsius", "20 de grade
celsius", "20 grade de celsius", "20 grade celsius".
This would actually allow things like "4 de grade", though it's fine as it
doesn't alter meaning.

Differential Revision: D8332923

fbshipit-source-id: e6ae0ecc902ac5db9be504b5ff6a14b1ec996413
2018-06-08 09:45:28 -07:00
Julien Odent
11316b34af Quantity/RO: Fix for values above 20
Summary:
In Romanian, for numerals above 20, we say "20 de livre", not "20 livre".
This would actually allow things like "4 de livre", though it's fine as it doesn't alter meaning.

Differential Revision: D8332867

fbshipit-source-id: 78ff193b027e547aa32a8f531d2f7ad895c6b668
2018-06-08 09:45:28 -07:00
Andreea Danielescu
bee838e1c5 AmountOfMoney/RO Support intervals
Summary: Added support for intervals (between X and Y), min, max and approximates for currency in RO.

Reviewed By: patapizza

Differential Revision: D8322948

fbshipit-source-id: 462cfd5575c87e757d2c35c8078f539af3e8150f
2018-06-08 09:00:31 -07:00
Julien Odent
bac1245f45 Duration/RO: Fix for values above 20
Summary: Same as previous commits.

Reviewed By: haoxuany

Differential Revision: D8325566

fbshipit-source-id: d4f1ae57cabdbdf8149f0673e6b7832496c2c88c
2018-06-07 16:45:43 -07:00
Julien Odent
567450beea Distance/RO: Fix for values above 20, refactoring
Summary:
* One rule to rule them all, to easily duplicate with "de" suffix.
* This would actually allow things like "4 de metri", though it's fine as it doesn't alter meaning.

Reviewed By: haoxuany

Differential Revision: D8325328

fbshipit-source-id: 3ec0f30431f3cb00152cc9509f6052b1ae29cd08
2018-06-07 16:45:43 -07:00
Julien Odent
483df26347 AmountOfMoney/RO: Fix for values above 20
Summary: In Romanian, we say "19 dolari", but for numerals above 20, it's "20 de dolari" (not "20 dolari").

Reviewed By: haoxuany

Differential Revision: D8324582

fbshipit-source-id: ffd29fa11bbc3a3f0da314f327d26c7b7890545f
2018-06-07 16:16:45 -07:00
Julien Odent
f272a175d4 Time/NL: Fix Sinterklaas for Belgium
Summary: In south Netherlands and in Belgium, Sinterklaas is celebrated on December 6.

Reviewed By: mullender

Differential Revision: D8281767

fbshipit-source-id: 4fc71783b9f543c4dfb04b8ba8481935cfb30dd8
2018-06-05 16:00:43 -07:00
Abdallatif
a00a0d7bdf fix dual big numbers in Arabic
Summary:
for 200, 2000, 2000000
Closes https://github.com/facebook/duckling/pull/202

Reviewed By: adelnobel

Differential Revision: D8257813

Pulled By: patapizza

fbshipit-source-id: d83ea31b9fdf4d28a61b75e84583ef0d7e7bea30
2018-06-04 14:45:37 -07:00
Aaron Yue
b64ff2f21b Time/EN: add <time> for <duration> rules
Summary: add rule for "from <time> for <duration>" and "<time> for <duration>" (symmetric to "for <duration> from <time>")

Reviewed By: patapizza

Differential Revision: D8195733

fbshipit-source-id: 86a0a24d847ea004aeed89ce8a144cb3311aee59
2018-05-31 09:30:30 -07:00
Aaron Yue
0726a40c2a Duration/EN: handle half time grains
Summary: add "a <time-grain> and a half" and "half a <time-grain>" for duration

Reviewed By: patapizza

Differential Revision: D8197599

fbshipit-source-id: ce4d229e7dd73906fe46d964bf48f8a1766a6e70
2018-05-30 13:30:45 -07:00
Edward Akerboom
ddbb6fdff8 Remove am/pm rule
Summary:
See https://github.com/facebook/duckling/issues/196
Closes https://github.com/facebook/duckling/pull/199

Reviewed By: patapizza

Differential Revision: D8098984

Pulled By: xhavokx

fbshipit-source-id: e6c7f94b8cda09c5f96c75052d333bced0c85ac2
2018-05-23 06:15:35 -07:00
Anshuman Chhabra
3e085fcfb1 Added TimeGrain to Hindi (HI)
Summary:
I have added __TimeGrain__ support to __Hindi (HI)__. Please let me know if there are any other changes required!

Cheers! :)
Closes https://github.com/facebook/duckling/pull/198

Reviewed By: patapizza

Differential Revision: D8082131

Pulled By: chinmay87

fbshipit-source-id: 73b8263a9f95775c32905edede14113c51b10431
2018-05-22 12:15:32 -07:00
RIAN DOUGLAS
ecceacb820 Implement Temperature intervals
Summary: Make some changes to allow the TemperatureValue type to support intervals.

Reviewed By: patapizza

Differential Revision: D7680835

fbshipit-source-id: d18c67fbb03f14d61cddb53dae3c544513cc67f2
2018-05-21 12:00:41 -07:00
RIAN DOUGLAS
a38794c7c4 Changes uses of 'financeWith' to use 'isSimpleAmountOfMoney' or 'isCurrencyOnly'
Summary: Changes uses of the financeWith function to use more specific methods which check for either a simple value, or only a currency, making the intent clearer

Reviewed By: haoxuany

Differential Revision: D8064995

fbshipit-source-id: 7321a4482aad8dbdbc7d734eb393220873ad0b51
2018-05-19 18:00:26 -07:00
Steve Gao
9c1be4ee47 Translate periodic holidays
Summary:
Add the support for periodic holidays in Chinese.

Canonical names of the holidays in Chinese are defined using simplified Chinese since it is used by the majority of the population.

Reviewed By: patapizza

Differential Revision: D8044583

fbshipit-source-id: c3db715b9d8c515c2013ab019012527033a17863
2018-05-17 20:00:27 -07:00
Tom Zhang
c0fce31f43 Update regex for Rosh Hashanah and Chanukkah
Summary: This updates the rules for Rosh Hashanah and Chanukkah to account for more alternative spellings. It's not exhaustive, but should catch some of the more common ones.

Reviewed By: patapizza

Differential Revision: D8039856

fbshipit-source-id: 7003c50518f5379f4e503d07f5d5b32a065c7ebc
2018-05-17 18:45:35 -07:00
RIAN DOUGLAS
884904b5ca Implement handling of "grand" for EN_?? locales
Summary: Add implementation of "a grand" and "<num> grand" for AU, BZ, CA, GB, IE, IN, JM, NZ, PH, TT, ZA locales. Some resolve to the local currency (AU, IN), others resolve to Dollar (NZ, PH).

Reviewed By: patapizza

Differential Revision: D7943186

fbshipit-source-id: c71ab462fa9df0ee65223ee82dc2c98457a4e13b
2018-05-17 15:45:27 -07:00
Anshuman Chhabra
8237ef4503 Added Duration support to Hindi (HI)
Summary:
Hello!

I have added __Hindi (HI)__ support for the __Duration__ dimension in ```Duckling/Duration/Rules.hs```. Written tests as well in ```Duckling/Duration/Corpus.hs``` and everything is passing and verified (`253 tests passed`).

Cheers!
Closes https://github.com/facebook/duckling/pull/194

Reviewed By: patapizza

Differential Revision: D7999571

Pulled By: chinmay87

fbshipit-source-id: deb5d60ba7f7ecbc2aa4d97ce5fb96e9bbe63b3d
2018-05-17 14:46:21 -07:00
Abdallatif
9f2fffec23 fix million in ar
Summary:
Fixes https://github.com/wit-ai/wit/issues/1080

Closes https://github.com/facebook/duckling/pull/195

Reviewed By: adelnobel

Differential Revision: D8030001

Pulled By: patapizza

fbshipit-source-id: 0dc0253ff8527c94c8e81a891f33898764336d6d
2018-05-16 14:45:42 -07:00
Matt Le
b28e6e56b1 Adding AD/BC parsing for years
Summary: Adds support for having years qualified with AD or BC.  This adds an extra field to the `TimeDatePredicate` to carry around the extra AD/BC info if it has been provided.

Reviewed By: patapizza

Differential Revision: D7940129

fbshipit-source-id: 993469b3ddd5eeca0e94f7c3d3dd061f37c77607
2018-05-11 16:00:29 -07:00
RIAN DOUGLAS
963aa6b465 Implement handling of "grand" for Ca and GB
Summary: Add implementation of "a grand" and "<num> grand" for EN_CA and EN_GB locales

Reviewed By: patapizza

Differential Revision: D7916643

fbshipit-source-id: 0cd55f17ec522c0334f48436a8a8cc19e0560b0b
2018-05-09 14:46:16 -07:00
Hugh Simpson
40e9421e86 Add millimeter units and UK spellings for Distance
Summary: Closes https://github.com/facebook/duckling/pull/183

Reviewed By: patapizza

Differential Revision: D7891858

Pulled By: panagosg7

fbshipit-source-id: 005176cd880958247e3d47aefeb6f6fdc2591dd1
2018-05-08 15:00:52 -07:00
Julien Odent
a11f10e282 Move Boss's Day to periodic list
Summary: no-op

Reviewed By: haoxuany

Differential Revision: D7912406

fbshipit-source-id: b5c0e6278563bb3a37b57a46a7c4338f44b7e907
2018-05-08 11:45:26 -07:00
mollerhoj
ae89565739 Remove the use of 'man' for Danish
Summary:
This has been bothering me for a while.

In Danish, 'man' means 'you'. E.g. "Kan man det?" translates to "Can you do that?".

As you can imagine, 'man' is used quite frequently. It used to cause a lot of false positives on facebook messenger, but it looks like FM is no longer using Duckling? Either way, unless you add a statistical layer on top of duckling, parsing 'man' as 'Monday' is the exception, not the rule.

This is my first PR, so bear with me if I've overstepped some contribution rules.
Closes https://github.com/facebook/duckling/pull/190

Reviewed By: blandinw

Differential Revision: D7891328

Pulled By: patapizza

fbshipit-source-id: 50c4adb05f206653194e4a151258f851dc9df682
2018-05-08 09:15:36 -07:00
Ziyang Liu
d44cc647a3 Parse 'second last week of October 2018'
Summary: Closes https://github.com/facebook/duckling/pull/191

Reviewed By: haoxuany

Differential Revision: D7894779

Pulled By: patapizza

fbshipit-source-id: 70ac906e7ce10e0c75843409f0dcb5f7629034f4
2018-05-07 15:15:28 -07:00
Julien Odent
cdda637d7c Time/EN_US: EMS week and EMSC day
Summary: 3rd full week in May, starting on a Sunday.

Reviewed By: chinmay87

Differential Revision: D7896050

fbshipit-source-id: aaae50b605a8d199b7134e90896da1de8785a11c
2018-05-07 12:00:50 -07:00
Ziyang Liu
aa3f9d08a6 Add Administrative Professionals' Day in EN_{AU,CA,NZ,US,ZA}
Summary:
* CA, US: Wednesday of the last full week of April
* AU: First Friday of May
* NZ: Third Wednesday of April
* ZA: First Wednesday of September

Closes https://github.com/facebook/duckling/pull/192

Reviewed By: chinmay87

Differential Revision: D7894777

Pulled By: patapizza

fbshipit-source-id: 4401c8a09758173965f08129a9b830a369a38941
2018-05-07 12:00:50 -07:00
Ziyang Liu
c84166d708 Add Quantity/ZH
Summary:
Fixes #181.
Closes https://github.com/facebook/duckling/pull/182

Reviewed By: patapizza

Differential Revision: D7891288

Pulled By: haoxuany

fbshipit-source-id: faa505dbf149c728545a92579cb2e92a89cd5cb8
2018-05-07 09:45:32 -07:00
Julien Odent
ccab5533c7 Time/EN_AU: Ekka
Summary:
Starts on the first Friday of August if it's not before August 5th,
otherwise on the second Friday of August.
10-day event, holiday on the Wednesday.

Reviewed By: chinmay87

Differential Revision: D7891529

fbshipit-source-id: 44edb3285851fc76e0de99f1581d8edf08ea9e7c
2018-05-07 01:15:26 -07:00
Julien Odent
5dbdc48047 Time/EN: Earth Hour
Summary:
Last Saturday of March unless it falls on Holy Saturday,
in which case it's the Saturday before, between 8:30pm and 9:30pm.

Reviewed By: chinmay87

Differential Revision: D7891433

fbshipit-source-id: e21ce54c865e8ee5280a374c8e8fd36571a2e550
2018-05-07 01:15:26 -07:00
Julien Odent
c6b0646493 Time/EN: Vesak
Summary:
According to Wikipedia (https://en.wikipedia.org/wiki/Vesak), Vesak
is celebrated differently across the globe.
As a first stab, taking the day of the full moon in May in the Gregorian
calendar.
Used https://eclipse.gsfc.nasa.gov/SKYCAL/SKYCAL.html to find the full moon in
May.

Reviewed By: chinmay87

Differential Revision: D7881429

fbshipit-source-id: b9897aa0dd32b01a569c8a040749df59cf78ce54
2018-05-06 11:00:34 -07:00
Julien Odent
662935fe64 Time/EN: Global Youth Service Day
Summary: and National variant for US

Reviewed By: chinmay87

Differential Revision: D7879055

fbshipit-source-id: d1db9fb5a3c4a00cb7332979ec12bb2d9935ca4e
2018-05-06 11:00:34 -07:00
Julien Odent
e9f4f21b21 Time/EN_US: Siblings Day
Summary: April 10, year over year.

Reviewed By: haoxuany

Differential Revision: D7878392

fbshipit-source-id: ed26b31d964b54805fc237c69ab1b5c680bac80b
2018-05-04 12:45:27 -07:00
Chinmay Deshmukh
a7f83ffe6a Time/EN: Make partial meridies latent
Summary: Make partial meridies latent to not flag spans like "A4 A5"

Reviewed By: patapizza

Differential Revision: D7866300

fbshipit-source-id: 2254750d643ca28474a5340731f9786617dcbadf
2018-05-03 15:45:33 -07:00
RIAN DOUGLAS
f328821bbc Add support for using 'grand' to refer to 1,000's of currency in EN
Summary: Added support for ",number> grand" and "a grand" to result in thousands of currency amount

Reviewed By: haoxuany

Differential Revision: D7688809

fbshipit-source-id: 72a81c7a1c48329f85c9f525b72b00c479a9edb0
2018-05-03 14:45:25 -07:00
Julien Odent
1976fd4543 Time/EN_US: Tax Day
Summary:
The first weekday on or after April 15 not falling on Emancipation
Day. Otherwise, the weekday after that.

Reviewed By: chinmay87

Differential Revision: D7745651

fbshipit-source-id: c215d903c250bac5ebc265192794fd324efda812
2018-04-30 13:45:25 -07:00
Julien Odent
b4c0f6ebd6 Time/EN_US: Fix Emancipation Day
Summary: Observed is the first weekday closest to April 16.

Reviewed By: haoxuany

Differential Revision: D7735190

fbshipit-source-id: f046dfb5c067464b83764f97114ccf9c805069d0
2018-04-24 11:01:27 -07:00
Julien Odent
d6143e98d7 Time/EN: Fix before/after/until/since + <year>
Summary: Reusing existing rules to be consistent.

Reviewed By: haoxuany

Differential Revision: D7735684

fbshipit-source-id: dd1699e095a2ae9754ec71e5d622c9378c308f17
2018-04-24 10:00:32 -07:00
Julien Odent
00d46b18f2 Time/EN: Absorb "since" before month/year
Summary:
since 2009, since February, etc.

https://github.com/wit-ai/wit/issues/1056

Reviewed By: haoxuany

Differential Revision: D7729314

fbshipit-source-id: a635cdab4ee5f077c77ef0c01180c805675cd0a7
2018-04-23 10:45:29 -07:00
Pavlo Kerestey
7b6cbf0ddb Support '2 thursdays ago|back'
Summary:
I have seen the Call for participation for #175 in Haskell News and thought I would give it a try and exercise in contributing to unknown haskell code.

As I am new to the project, I have probably done a mistake of committing the classifiers. The commit got reverted but it is still associated with the issue. Lesson learned: don't tag commit messages wit the issue numbers.
Closes https://github.com/facebook/duckling/pull/180

Reviewed By: patapizza

Differential Revision: D7717445

Pulled By: haoxuany

fbshipit-source-id: d818f351d03b6c8b3d77984b2060a0a14230696f
2018-04-20 16:45:33 -07:00
Ziyang Liu
a3b35880e5 Change value in Entity to typed value instead of JSON
Summary:
Modified `Entity` to use the new `ResolvedVal` data type. Other changes follow naturally. Related issues: https://github.com/facebook/duckling/issues/121 and https://github.com/facebook/duckling/issues/172

Now one can pattern match on the output value, for instance:

```
{-# LANGUAGE GADTs #-}

import Data.Text
import Duckling.Core
import Duckling.Testing.Types
import qualified Duckling.PhoneNumber.Types as PN

parsePhoneNumber :: Text -> Text
parsePhoneNumber input =
  case value entity of
    (RVal PhoneNumber (PN.PhoneNumberValue v)) -> v
    where
    (entity:_) = parse input testContext testOptions [This PhoneNumber]
```

Reviewed By: patapizza

Differential Revision: D7502020

fbshipit-source-id: 76ba7b315cfd0d2c61ff95c855b7c95efc0a401c
2018-04-20 14:18:47 -07:00
Julien Odent
e15efc4336 Time/EN: Vasant Panchami, Holika Dahan, Holi
Summary: Moar Hindu holidays.

Reviewed By: chinmay87

Differential Revision: D7704148

fbshipit-source-id: 90fc611021389585c35b667d822cbe67e281d48d
2018-04-19 18:45:29 -07:00
Ziyang Liu
5460d8df0e Support custom dimensions
Summary:
Support custom dimensions

Had to move the definition of `Dimension` from `Duckling.Dimensions.Types` to `Duckling.Types` to avoid cyclic imports between these two modules.

A sample custom dimension is in `exe/CustomDimensionExample.hs`.

Limitations of custom dimensions:

- All rules for a custom dimension must be in the same module with the definition of the custom dimension. Otherwise there will be cyclic imports, because the definition of the dimension and the rules refer to each other.
- The custom dimension must be specified when using `parse`, since there's no way to get all the existing custom dimensions.

Reviewed By: patapizza

Differential Revision: D7630360

fbshipit-source-id: 30e12dcb33611f5692c4f5949de377bf61b75e1e
2018-04-19 15:30:51 -07:00
Julien Odent
eccf5c8f24 Time/EN: More Hindu holidays
Summary:
* Raksha Bandhan
* Pongal
* Onam

Reviewed By: chinmay87

Differential Revision: D7662179

fbshipit-source-id: f29f9bdadb70455956ddf8c65afc34309e7e25d0
2018-04-19 11:00:50 -07:00
Julien Odent
9c8619cbc9 Time/EN: Navaratri holidays
Summary: Added Navaratri-related holidays from 2000 to 2030.

Differential Revision: D7661419

fbshipit-source-id: ab5cf5c4fe9a4019cf51e9569692a03321667bf4
2018-04-19 11:00:50 -07:00
Julien Odent
1f1837c47b Time/EN: Diwali holidays
Summary: Adding Diwali-related holidays from 2000 to 2030.

Reviewed By: chinmay87

Differential Revision: D7660326

fbshipit-source-id: aff8de97b266f797ff759655982252e7e259e87f
2018-04-19 11:00:50 -07:00
Quan
c166179d89 Use comma "," as decimal separator for VI
Summary:
In Vietnam, we use comma "," as decimal separator instead of dot "."
Closes https://github.com/facebook/duckling/pull/176

Reviewed By: patapizza

Differential Revision: D7601328

Pulled By: panagosg7

fbshipit-source-id: 7f5725006f9054fe45a24757ec2abc36b7aa6605
2018-04-18 23:15:30 -07:00
Aaron Yue
4df76289bc Implement AmountOfMoney
Summary: implement AmountOfMoney rules and corpus for ZH

Reviewed By: patapizza

Differential Revision: D7508507

fbshipit-source-id: 3591b399a9880c5278587979c6576720343cc123
2018-04-17 16:45:32 -07:00
Aaron Yue
babe317723 fix intersect rule to work with negative numbers
Summary:
Numerals that require intersection with negative numbers don't work, since the negative sign gets parsed
before the intersect rules happen. This fixes it by adding a guard in for positive in the intersection rule.

Reviewed By: patapizza

Differential Revision: D7592225

fbshipit-source-id: 2bc9c708cadeea4012c1f3ef487c61a144325f2a
2018-04-13 19:45:40 -07:00
Chinmay Deshmukh
17e1845e12 Time/EN_CA, EN_US: Add "Groundhogs day" in regex for "Groundhog Day"
Summary: Modify regex to add "Groundhogs day" in regex for "Groundhog Day" in US and CA

Reviewed By: patapizza

Differential Revision: D7605031

fbshipit-source-id: 0cbb45d4edde3345437872f2e5b366c39f6a8b54
2018-04-13 12:15:31 -07:00
Julien Odent
de977fe5cc Duration: Move composite duration rule to English
Summary: "and" is language-specific.

Reviewed By: chinmay87

Differential Revision: D7605874

fbshipit-source-id: 59adcee4784baebe3b9eb775b6763bf3bba8ef8d
2018-04-12 15:15:29 -07:00
RIAN DOUGLAS
fd267ee80b Time/EN: Make "may" latent
Summary: Extended method for making months from a pair, to take a 3-tuple, including a flag indicating whether to make the result latent. Implement the previous mkRuleMonths method in terms of this.

Reviewed By: patapizza

Differential Revision: D7491037

fbshipit-source-id: 4d4c41b46dc0390e17b521480f3daf8306f23834
2018-04-12 14:00:29 -07:00
Aaron Yue
fe0807dced Use lambda-case for Rule production
Summary: change Rule production functions to lambda-case

Reviewed By: patapizza

Differential Revision: D7424413

fbshipit-source-id: edac0290d310578f633ff0208434d1eca038ad9c
2018-04-12 10:15:57 -07:00
Aaron Yue
4ef255e577 Generalize and expand digit specifier usage for hanzi
Summary:
generalize chinese digit specifier (十百千万亿) parsing, and add hanzi tests
These digits specifiers can be parsed as (<num><speci>)<num>,
by using the multiplicater value <num><speci>, and a connect function that adds them together
(two cases, skipping digits [which requires a 零 in between], and digits in consecutive locations).
Note that 个 is technically a digit specifier,
but in Chinese it is never used directly as a numeral specifier, and always as a counter.

Reviewed By: zliu41

Differential Revision: D7424249

fbshipit-source-id: 20a85a7df1f908ee9879e92b904178fa26a9a5e5
2018-04-12 10:00:33 -07:00
Chinmay Deshmukh
f355abacc5 Time/EN: time + n years ago/in n years
Summary:
Add support for things like -
"mlk day three years ago"
"mlk day in three years"
"Labor Day one year from now"

"Thanksgiving in one year"
"Thanksgiving in 2013"

"january in a year"
"january 3 years ago"

Reviewed By: patapizza

Differential Revision: D7581591

fbshipit-source-id: 6f37a83c5acbff28672c2e8a958eaf37c679cab3
2018-04-12 01:10:17 -07:00
Julien Odent
c539ba2f55 Time/EN: Tu BiShvat
Summary: Added precomputed Jewish holiday `Tu BiShvat`.

Reviewed By: chinmay87

Differential Revision: D7596389

fbshipit-source-id: ed770dfa0eca982d5d1896dacff6443ee0fa2d30
2018-04-11 20:15:42 -07:00
Julien Odent
443caeb096 Time/EN_AU: Reconciliation Day
Summary:
First Monday on or after May 27th:
https://publicholidays.com.au/reconciliation-day/

Reviewed By: chinmay87

Differential Revision: D7596237

fbshipit-source-id: 5ad4effb30d1e09a988c93fdb85f9dc60d0a1e54
2018-04-11 20:15:42 -07:00
Souvik Ghosh
ced73dcdcb AmountOfMoney NL Support
Summary:
Hello,
I have added new directory for AmountOfMoney NL Support
Added two files
- Duckling/AmountOfMoney/NL/Corpus.hs
- Duckling/AmountOfMoney/NL/Rules.hs

Updated File
- Duckling/Rules/NL.hs

Added test cases
- tests/Duckling/AmountOfMoney/NL/Tests.hs

Updated Test file
- tests/Duckling/AmountOfMoney/Tests.hs

Updated
duckling.cabal

Thanks for the review and the latest merge. Looking forward

Regards
Closes https://github.com/facebook/duckling/pull/173

Reviewed By: JonCoens

Differential Revision: D7592192

Pulled By: patapizza

fbshipit-source-id: 5895c29bf7f1033e4ffd791d5915a16d230e9375
2018-04-11 17:15:30 -07:00
Julien Odent
120f569ed0 Time/EN: Fix "in" + year
Summary: Now that years are latent, let's absorb the "in" and make them not latent.

Reviewed By: zliu41

Differential Revision: D7587599

fbshipit-source-id: 61a19ac389244df491591d78c28f0301f9124439
2018-04-11 11:00:30 -07:00
Lucas Hosseini
528fea9ad4 Make all years latent
Summary: Make all years latent to prevent any four digit number to be considered a year.

Reviewed By: patapizza

Differential Revision: D7559843

fbshipit-source-id: f3a8625dd7d74edfffb13401278d6b4a5110359a
2018-04-11 05:15:31 -07:00
Julien Odent
944e8d73c2 Time/EN: Islamic holidays
Summary:
Islamic holidays from a few pre-computed reference times, based on the Umm al-Qura Calendar of Saudi Arabia.
http://www.staff.science.uu.nl/~gent0113/islam/ummalqura.htm
http://www.staff.science.uu.nl/~gent0113/islam/ummalqura_principal.htm

Reviewed By: chinmay87

Differential Revision: D7578193

fbshipit-source-id: b9e4428ad91058c24495ce27a0ae945b91291d4f
2018-04-10 16:15:26 -07:00
Chinmay Deshmukh
c567abea1c Time/EN: Rule <Day of month> of month
Summary:
Rule to resolve things like:
"27th of next month"
"15th of last month"
"3rd of this month"

Reviewed By: patapizza

Differential Revision: D7543740

fbshipit-source-id: 20bdc194ed7d1466e2ca42c87b73a04ace7c29ab
2018-04-09 16:45:37 -07:00
Danny Su
1c6ebffb46 Time/ES: use mkRuleSeasons
Summary:
- removed ruleSeason, ruleSeason2, ruleSeason3, ruleSeason4
- replaced above with ruleSeasons and use the `mkRuleSeasons` helper

Reviewed By: patapizza

Differential Revision: D7545455

fbshipit-source-id: 57842f52ab3ab954ba31a200942970b6d0bd040e
2018-04-09 12:30:37 -07:00
Oleksii Dykan
e0e2338dd1 Add proper EOY and EOM rules
Summary: Added rules to cover EOY, EOM, BOY, BOM

Reviewed By: zliu41

Differential Revision: D7492089

fbshipit-source-id: fb0c787d709146534980ccc53e240ae88740a553
2018-04-09 08:15:33 -07:00
Julien Odent
18934b81e2 Time/EN: Fix computed past series + Jewish holidays
Summary:
* Fixed computed past series
* Added a few Jewish holidays, pre-computed and built upon.

Reviewed By: chinmay87

Differential Revision: D7511694

fbshipit-source-id: c66a34e6634a9f86101fb2fd3b4a372d75ba5711
2018-04-06 19:15:25 -07:00
Ziyang Liu
c819dcb665 add Discovery Day in EN/CA
Summary: add Discovery Day in EN/CA

Reviewed By: patapizza

Differential Revision: D7527814

fbshipit-source-id: 053e70b59c121e6853f743cd5b9a2b1a4a45e38c
2018-04-06 13:45:50 -07:00
Ziyang Liu
3547fa3472 Add Boss's Day (closest working day to Oct 16) in EN
Summary: Add Boss's Day (closest working day to Oct 16) in EN

Reviewed By: patapizza

Differential Revision: D7512241

fbshipit-source-id: c8a4a14b77677ed34edebfeb48bfce1019bb059d
2018-04-05 18:00:49 -07:00
Rajesh Shenoy
7a76c938da Add distance to SV
Summary: Earlier distance was implemented, but it was not defined

Reviewed By: patapizza

Differential Revision: D7524341

fbshipit-source-id: e1e8342a6eff5a523a0db31bf301870ae27c513e
2018-04-05 16:00:33 -07:00
Aaron Yue
e542ff5b50 Distribute ruleUnitAmount to all languages
Summary:
enforce units are checked in ruleUnitAmount and ruleAmountUnit, and distribute ruleUnitAmount to all
languages, since in some languages this doesn't work (such as for ZH, where value units must succeed amounts)

Reviewed By: patapizza

Differential Revision: D7509840

fbshipit-source-id: 3a79b39721850f9d0289442925fbc02cf69abefb
2018-04-05 10:45:35 -07:00
Julien Odent
7b25f5c564 Time/EN: Chinese New Year
Summary: Added computed Chinese New Year.

Reviewed By: chinmay87

Differential Revision: D7492868

fbshipit-source-id: 203f6645dd39adb3ae3a0e97d99c79a1e10a3d93
2018-04-03 16:30:27 -07:00
Julien Odent
04f215febb Time/EN: fix Labour Day, add Heroes' Day and National Patriots' Day
Summary:
* fixed Labour Day for most locales
* added Heroes' Day for JM, PH and ZA
* National Patriots' Day for CA

Reviewed By: chinmay87

Differential Revision: D7492156

fbshipit-source-id: 2a99412a55190ffa5a541b47f6d92d0df928fc3b
2018-04-03 16:00:30 -07:00
Julien Odent
9a734b3d6a Time/EN: Orthodox Easter and -based holidays
Summary:
* precomputed Orthodox Easter dates
* added Orthodox Easter-based holidays for English

Reviewed By: chinmay87

Differential Revision: D7490875

fbshipit-source-id: d24210f6ef01dc10dd9f1f84205f180af7402bb4
2018-04-03 16:00:30 -07:00
Julien Odent
59a9784061 Time/EN: Easter-based holidays
Summary:
- added Easter-based holidays
- fixed mother's day for `GB`

Reviewed By: chinmay87

Differential Revision: D7482119

fbshipit-source-id: e28345a7a3d262e52878ffac1e79b7d2cfb0ed98
2018-04-03 12:15:29 -07:00
Ziyang Liu
7ae9e50c6a Add EN support for this|last|next season
Summary: Add EN support for this|last|next season

Reviewed By: patapizza

Differential Revision: D7443814

fbshipit-source-id: 925296f793fbe03bcb67d8a6af3eb6695347eedd
2018-04-03 01:45:26 -07:00
Ziyang Liu
28e88e9390 Add composite durations
Summary: Add composite durations

Reviewed By: patapizza

Differential Revision: D7450056

fbshipit-source-id: 0d571529341e742a60ecc2cd6e2b13ddc9ac5b1e
2018-04-02 19:30:26 -07:00
Chinmay Deshmukh
e7f285cd1d Time: Return Holiday Name in response (Beta)
Summary:
Return the canonical holiday name if the input had a holiday in it and the date resolves to the date of the holiday.

Add `holiday` to `TimeData`.
Set it in the holiday rule.
Make sure it propogates appropriately in `predNth` and `intersect`.
Make sure it doesn't propogate in other rules.
Add `holiday` to `TimeValue` and set it during `resolve`

Reviewed By: patapizza

Differential Revision: D7441387

fbshipit-source-id: d57602fd294dc6149ab044c05065c1b9250cb331
2018-04-02 10:45:32 -07:00
Julien Odent
2aa05971be Time/EN: More periodic holidays
Summary:
* Added periodic holidays for all English locales
* Fixed father's day in Australia and New Zealand

Reviewed By: chinmay87

Differential Revision: D7450426

fbshipit-source-id: 9ddcf7f08e73e2bb501541d9697d64b7e99a8ef1
2018-03-29 17:00:33 -07:00
Julien Odent
4175fde41a Time/EN: More fixed holidays
Summary: added more fixed dates holidays for English locales

Reviewed By: chinmay87

Differential Revision: D7446233

fbshipit-source-id: 87c30c82c7b4ca9a5a0b2b21bff50d9288ad15e3
2018-03-29 17:00:33 -07:00
Aaron Yue
a9bd094af2 Remove unused and redundant rule
Summary: remove `ruleLastTuesdayLastJuly`, it does the exact same thing as `ruleLastTime`

Reviewed By: patapizza

Differential Revision: D7445836

fbshipit-source-id: 95667db4ce376223acce0ea36a6a0493946ceea1
2018-03-29 15:45:33 -07:00
Ziyang Liu
0c7edb01a9 Add EN support for last night and late last night
Summary: Add EN support for last night and late last night

Reviewed By: patapizza

Differential Revision: D7369829

fbshipit-source-id: bd1dbecf247e428307adfae3e8e83840f6de77b1
2018-03-27 15:45:41 -07:00
Chinmay Deshmukh
131442abd3 Time/EN: "Late Tonight"
Summary:
Add rule for "late tonight" that resolves to 9 pm

Note: Will handle "later tonight" separately

Reviewed By: patapizza

Differential Revision: D7363574

fbshipit-source-id: da26925b7f61424318e4ac99f743138d9ab09e43
2018-03-26 11:15:28 -07:00
Chih-Wei Chang
b0187b27cc Refactor pattern match to hashmap lookup
Summary: Use `HashMap.lookup` to replace the guard match for performance optimization for ordinal rules in Russian.

Reviewed By: chinmay87

Differential Revision: D7372645

fbshipit-source-id: 20555c352a3f65387e0630f5df65c0826af389f1
2018-03-23 12:01:02 -07:00
Oleksii Dykan
5c59b0a214 Add missing month / week / year rules
Summary: Added rules for the beginning / end of year / month / week

Reviewed By: patapizza

Differential Revision: D7356994

fbshipit-source-id: 43489b3709b8ab586384321cf9bc79c45668162a
2018-03-22 11:45:29 -07:00
Wojtek Przechodzeń
15722cc19d two failing tests for day with month
Summary:
Hello,
I wanted to fix problem with two months - May and November for PL language, since it is what I need to use in [wit.ai](http://wit.ai), but.. I'm not sure how to do that. I've created two failing tests, checked `Rules`, but there are already some rules which are responsible for that cases:

`20 listopada` :
`, ( "November" , "listopad|listopada|listopadowi|listopadem|listopadzie|lis\\.?|list\\.?" )`

`20 maja`:
`, ( "May" , "maj|maja|majowi|majem|maju" )`

Can you help me somehow fix that issues because I'm not sure how I can force Duckling to use proper regexp? :)
Closes https://github.com/facebook/duckling/pull/161

Reviewed By: patapizza

Differential Revision: D7353495

Pulled By: panagosg7

fbshipit-source-id: b0c70172e4cc9dbd4635ed64e89ffb463b643f90
2018-03-21 17:00:32 -07:00
Julien Odent
6ee8933139 Distance/SV: fix mil
Summary: 1 mil = 10 km (not 1 km)

Reviewed By: chinmay87

Differential Revision: D7356382

fbshipit-source-id: fc1418216346c3351e1206f1ae59df46a2b8a713
2018-03-21 14:15:29 -07:00
Alex Zveryansky
33ef33787d DDMMYYYY/MMDDYYYY parsing to phone fix
Summary:
"DD MM YYYY", "MM DD YYYY" parsed only as a phone number, but it is also a popular datetime format.
I have added new time patterns and tests for this cases.
Closes https://github.com/facebook/duckling/pull/163

Reviewed By: patapizza

Differential Revision: D7320048

Pulled By: panagosg7

fbshipit-source-id: 5ccf1ccca173126f5d2b9b8b2664181f3b13f78b
2018-03-21 12:45:30 -07:00
Ziyang Liu
22d11c055b Add ZH distance support
Summary: Add ZH distance support

Reviewed By: patapizza

Differential Revision: D7341977

fbshipit-source-id: 301d90515c492da9fa4c4faf5bcc3351eacbed1b
2018-03-21 12:15:28 -07:00
Julien Odent
1a41d3f7f4 Time/EN_US: Washington's birthday/President day + Lincoln's birthday
Summary:
https://en.wikipedia.org/wiki/Washington%27s_Birthday
https://en.wikipedia.org/wiki/Lincoln%27s_Birthday

Reviewed By: chinmay87

Differential Revision: D7344331

fbshipit-source-id: 800dc1b8653efab034afcffc9077e7f67bdf59b8
2018-03-21 11:30:29 -07:00
hend
f70b4ebe07 add distance to SV
Summary: Closes https://github.com/facebook/duckling/pull/168

Reviewed By: chinmay87

Differential Revision: D7322559

Pulled By: patapizza

fbshipit-source-id: 3d4b86068c05a7a82442bc7c182b80b5cf75ec90
2018-03-21 11:15:25 -07:00
Julien Odent
6d7d0ba354 fix build
Summary: `Duckling.Resolve.Options` clashes with `Data.Aeson.Options`.

Reviewed By: niteria

Differential Revision: D7337751

fbshipit-source-id: c9dc633301d45704dbb4975d1942fc5f360a4a44
2018-03-20 10:30:35 -07:00
yasen-yankov
21c3b32e4d Added TimeGrain, Duration, and Ordinal
Summary: Closes https://github.com/facebook/duckling/pull/164

Reviewed By: chinmay87

Differential Revision: D7280110

Pulled By: patapizza

fbshipit-source-id: d98ddd900fe83f06b28afd39ea3311f42716288c
2018-03-19 18:00:29 -07:00
Giri Anantharaman
519c9519a3 Support Tamil numerals
Summary:
* Setup Tamil (TA) language
* Added Numeral Dimension

Reviewed By: patapizza

Differential Revision: D7323636

fbshipit-source-id: 4b1a42197ff4799880cded9ce86b8d7fae1507bc
2018-03-19 16:45:36 -07:00
Chinmay Deshmukh
5ac990bbe2 Return latent entities
Summary: Add an option to return latent time entities. This can be used when one is pretty certain that the input contains a datetime.

Reviewed By: patapizza

Differential Revision: D7254245

fbshipit-source-id: e9e0503cace2691804056fcebdc18fd9090fb181
2018-03-19 14:45:27 -07:00
Julien Odent
490799fe4a Time/EN: Periodic holidays
Summary:
* added periodic holidays for all existing English locales
* moved Independence Day from common to US, as it is country-dependent
* moved Memorial Day from common to US, as it is country-dependent (fixed the one for Canada)
* added Decoration Day as an alias for US Memorial Day

Reviewed By: chinmay87

Differential Revision: D7294129

fbshipit-source-id: 89cdbf91b4c43e1996fa1f4509eac1d1b1978197
2018-03-16 17:17:08 -07:00
yasen-yankov
1493d44465 Added BG distance
Summary: Closes https://github.com/facebook/duckling/pull/162

Reviewed By: chinmay87

Differential Revision: D7239243

Pulled By: patapizza

fbshipit-source-id: a5518219a67fa46bb06e97eee3dfd07ab683162f
2018-03-13 15:45:32 -07:00
Julien Odent
af0751a748 Time/EN: handle Easter
Summary:
* introducing `Duckling.Time.Computed` for pre-computed days
* handle Easter Sunday and Easter Monday from 1950 to 2050

Reviewed By: JonCoens

Differential Revision: D7207643

fbshipit-source-id: 13e1d6d10dc9cd5d18ef7ff0c50d99e695c3cb1f
2018-03-13 10:15:50 -07:00
Julien Odent
ad0ab1d98e Time/DE,EN,NL: fixes + refactoring
Summary:
* added `okForThisNext` flag for holidays/seasons/months/days of week rules
* fixed `mkRuleHolidays` argument ordering
* reused helpers in English

Reviewed By: JonCoens

Differential Revision: D7200945

fbshipit-source-id: 01da94f5ba929a37a379b5b9efd68961892a926c
2018-03-12 09:45:37 -07:00
Ezgi Çiçek
2254034e62 Add Node to Entity to pass along the parse tree information
Summary:
- add `Node` field to `Entity`
- ignore `Node` field of `Entity` for toJSON for now (will be fixed later)
- change `Debug.hs` so that we print the respective Entity's Node
- add wildcard for the new Node field in `parseTest` of Api/Tests.hs`

Reviewed By: patapizza

Differential Revision: D7174696

fbshipit-source-id: 240e4c53b72323b500ac58a74f873ce247bb3387
2018-03-07 10:45:28 -08:00
Panagiotis Vekris
169df6b46b ruleSkipHundreds only accepts alphabetic numerals
Summary:
Before, duckling would parse `"1 2 2"` as the three digit number 122 through
`ruleSkipHundreds`. This, however, allowed the string `"Pay Kiran1 10eur"` to be
parsed as "110 EUR", which was reported in https://github.com/facebook/duckling/issues/159.

This change only accepts alphabetic numerals to pass through `ruleSkipHundreds`
(for example `"one twenty two"`), which presumably was the original intention of
this rule. This fixes the above issue, without any change in Corpus.

Reviewed By: patapizza

Differential Revision: D7151934

fbshipit-source-id: 024a7a0b6a53beb3a0d42d4bb7f542ce3b05726b
2018-03-06 17:00:29 -08:00
Bora Tunca
002dec5614 Support lowercase time zones
Summary: Support lowercase time zones

Reviewed By: patapizza

Differential Revision: D7114137

fbshipit-source-id: 906c4fa5305aea8990e8a5d480ceeec4b584d7db
2018-03-01 14:30:29 -08:00
Chris Reid
b637deedc7 Add EN Quantity Support Intervals
Summary: Added support for quantity intervals (eg. between, above, below) and EN rules.

Reviewed By: patapizza

Differential Revision: D6985854

fbshipit-source-id: 1c63e14c66f5a6391960270e232aa10bf87307b4
2018-02-22 09:30:29 -08:00
Julien Odent
aed5b8f779 Numeral: don't compose negative numbers, fix double negatives
Summary:
* added `isMultipliable` helper and used that in patterns along with `isPositive`
* fixed double negatives in most languages

Reviewed By: niteria

Differential Revision: D7034982

fbshipit-source-id: a0bb67056d3107167830ece0c34d761c5563c5a7
2018-02-21 12:02:45 -08:00
Julien Odent
55b0d1d437 Distance: Don't return type in interval bounds
Summary: We were returning `"type":"value"` for each bound.

Reviewed By: blandinw

Differential Revision: D7011092

fbshipit-source-id: d2b5c4d28505a1f24749ecc3975e04c7ba7a6fe1
2018-02-16 11:30:32 -08:00
bidhan-a
43079e7113 Setup Nepali (NE) and add Numeral dimension
Summary:
- Setup Nepali (NE) language
- Add basic Numeral dimension
Closes https://github.com/facebook/duckling/pull/156

Reviewed By: JonCoens

Differential Revision: D6965558

Pulled By: patapizza

fbshipit-source-id: f46c9b104d4345f20bd0cf53f8c9c8754855f314
2018-02-13 07:45:31 -08:00
Julien Odent
c7fb533a67 Url: handle fragments
Summary: https://github.com/facebook/duckling/issues/155

Reviewed By: JonCoens

Differential Revision: D6967145

fbshipit-source-id: 44e573b57c714a62d93d74063f597d31feb8c6f5
2018-02-12 13:00:29 -08:00
Lucas Hosseini
1f7290880c Distance interval support.
Summary: Interval support for distances (common types + EN rules).

Reviewed By: patapizza

Differential Revision: D6942340

fbshipit-source-id: d05ff337167b11c9186f38ca04bacf0d24a41526
2018-02-09 16:16:04 -08:00
Ashwini Reddy Challa
c8501d3e85 Added HI Ordinals
Summary: Added ordinal support for Hindi

Reviewed By: patapizza

Differential Revision: D6944156

fbshipit-source-id: eb5da698e5cccde9a1cc31adf7bc433b89e07454
2018-02-09 13:15:30 -08:00
Abdallatif Sulaiman
0c395f7a1b fix Valentine's Day regex in arabic
Summary: Closes https://github.com/facebook/duckling/pull/146

Reviewed By: adelnobel

Differential Revision: D6834246

Pulled By: patapizza

fbshipit-source-id: ba90be16e877f9a39162820f1071ce7a6d6da6d7
2018-02-05 14:30:34 -08:00
Panagiotis Vekris
7a89ced6db Intervals for AmountOfMoney
Summary:
Adds support for intervals for amounts of money, e.g. "entre 12 euros et 15 euros"

Addresses https://github.com/facebook/duckling/issues/151

Reviewed By: patapizza

Differential Revision: D6870091

fbshipit-source-id: 750815129159e75323d00aa56fdda898baa32fdc
2018-02-02 17:15:28 -08:00
Bill Cromie
197fef1b5e Ordinals with spaces, en-dashes and more!
Summary:
Adding more support for "natural" language compound ordinals:
"twenty nine", "twentynine", and "twenty–nine".

These tend to come up in text that has been transcribed from audio, informal user input, and more formal printed material respectively.
Closes https://github.com/facebook/duckling/pull/152

Reviewed By: panagosg7

Differential Revision: D6850514

Pulled By: patapizza

fbshipit-source-id: 1d3491655cfc1fb3faab0c3e196de1b2361ae95e
2018-02-01 14:30:44 -08:00
Julien Odent
b00fa512af AmountOfMoney: fixes
Summary:
* don't recursively compose cents
* don't allow decreasing ranges

Reviewed By: blandinw

Differential Revision: D6849132

fbshipit-source-id: ed6ca30388642c21e677a628971747a4fb3dfbef
2018-01-30 14:45:36 -08:00
Julien Odent
bef7a44fa8 Remove redundant brackets and language pragmas
Summary: .

Reviewed By: JonCoens

Differential Revision: D6838082

fbshipit-source-id: 94757bdb80c6d3c29a7a6554429940a1b7403108
2018-01-29 16:45:28 -08:00
Filipe Pereira
81a97575f6 PR for issue #148
Summary:
patapizza Did my best, but I'm neither fluent on Dutch or Haskell :) I tried keeping it consistent with the existing code, let me know if there's something I can improve!
Closes https://github.com/facebook/duckling/pull/149

Reviewed By: blandinw

Differential Revision: D6809767

Pulled By: patapizza

fbshipit-source-id: f92802b94ed7588a03219f63e74dbab475e950ab
2018-01-26 09:46:04 -08:00
Magnus Burton
7d864e38ab Added more synonyms to about <duration>
Summary:
Added some more synonyms to the duration part of the Swedish Duckling. This will match even more **valid** durations that match `about <duration>`.
Closes https://github.com/facebook/duckling/pull/145

Differential Revision: D6775860

Pulled By: patapizza

fbshipit-source-id: d0c844747e3bbb60c2500fb4b79aa53c2680ab48
2018-01-22 17:02:16 -08:00
vxovka
b964d02a7d Russian ordinals fixes and additions
Summary:
Fixed 3rd ordinal which didn't work for feminine and neuter genders in nominative.
Fixed when ordinals from 1 to 19 not recognized when used with capital letters.
Added support for ordinals in genitive for all genders.
Closes https://github.com/facebook/duckling/pull/141

Reviewed By: patapizza

Differential Revision: D6740190

Pulled By: panagosg7

fbshipit-source-id: a6a676d95890a7e156346f479c84a71c1b2bd17f
2018-01-21 23:00:41 -08:00
Julien Odent
7f21d1d7d7 Time/EN: Parse MM.DD.YYYY (or DD.MM.YYYY)
Summary:
Fixes #143.

Doesn't allow for MM.DD.YY (or DD.MM.YY) as this clashes with HHMMSS.

Reviewed By: blandinw

Differential Revision: D6765534

fbshipit-source-id: 1d1720e5bb292fdb3970e76475f35eab316048a8
2018-01-19 19:15:49 -08:00
Akshay Patil
d590f098dc Add type for Duration
Summary: Added missing `type` for Duration.

Reviewed By: patapizza

Differential Revision: D6717680

fbshipit-source-id: d1454758a3852bb5c06fb7a14224012cb3085a58
2018-01-16 15:15:27 -08:00
Julien Odent
da36ab8a80 Time: fix empty values for past time
Summary: "yesterday" would resolve to an entity without any `values`.

Reviewed By: JonCoens

Differential Revision: D6697432

fbshipit-source-id: 7b15727f92703842a2995210fdeb99c00be74bc3
2018-01-10 15:30:32 -08:00
Julien Odent
ffdb976dd4 Time/SV: Add more examples
Summary: #140.

Reviewed By: panagosg7

Differential Revision: D6667848

fbshipit-source-id: 861fb87caf10cac64f0fe2eaa5186a70da6a3245
2018-01-05 12:15:40 -08:00
Filipe Pereira
9f78ebd801 PR for issue #136
Summary: Closes https://github.com/facebook/duckling/pull/139

Reviewed By: panagosg7

Differential Revision: D6661224

Pulled By: patapizza

fbshipit-source-id: 4802c2f66efd017577f3247e3b4abddcb7496c3f
2018-01-05 12:15:40 -08:00
Abdallatif Sulaiman
ce2f48fbb5 Quickfix for Arabic Numeral
Summary: Closes https://github.com/facebook/duckling/pull/137

Reviewed By: adelnobel

Differential Revision: D6660959

Pulled By: patapizza

fbshipit-source-id: 51169c63558b5a35f16bdaaada9649c88a4d2994
2018-01-05 11:45:40 -08:00
Abdallatif Sulaiman
89822776c6 Added Amount of Money Dimension to Arabic language
Summary: Closes https://github.com/facebook/duckling/pull/134

Reviewed By: JonCoens

Differential Revision: D6649920

Pulled By: patapizza

fbshipit-source-id: 9c647c84f5ae4f3dc26cb0c7aa74abb097ea001a
2018-01-02 14:00:51 -08:00
Abdallatif Sulaiman
2d726d3837 Added Quantity Dimension to Arabic language
Summary: Closes https://github.com/facebook/duckling/pull/127

Reviewed By: panagosg7

Differential Revision: D6616298

Pulled By: patapizza

fbshipit-source-id: dc774ff1e870bbd083a9cca8ee6f75db852afce9
2017-12-20 18:00:43 -08:00
Abdallatif Sulaiman
c056a0b46a Added Temperature Dimension to Arabic language
Summary: Closes https://github.com/facebook/duckling/pull/126

Reviewed By: panagosg7

Differential Revision: D6614995

Pulled By: patapizza

fbshipit-source-id: 35ff142a3fc8a498d9abbb80d28dc9be6cdcbc4d
2017-12-20 18:00:43 -08:00
Abdallatif Sulaiman
380457db8f Added Volume Dimension to Arabic language
Summary: Closes https://github.com/facebook/duckling/pull/125

Reviewed By: panagosg7

Differential Revision: D6614574

Pulled By: patapizza

fbshipit-source-id: 054ed04e0cc1cf79be31340ebb8b7fea3bc67f57
2017-12-20 18:00:43 -08:00
Abdallatif Sulaiman
1393098bcc Added Time Dimension to Arabic
Summary:
Hi, in this pr:
* Added time dimension to Arabic language, thanks to Hussein-Dahir & Yazeed-Obaid for writing time corpus.
* Fixed some bugs in numeral & ordinals and added more test cases for them.

Also, I don't really understand why do we use classifiers in time dimension?
Closes https://github.com/facebook/duckling/pull/123

Reviewed By: blandinw

Differential Revision: D6583313

Pulled By: patapizza

fbshipit-source-id: f7acdef0c032d7b7fd7d224832fdaf484d2df825
2017-12-19 14:30:42 -08:00
Newinfinite007
c133bad24a Hindi Language Numeral Dimension(minimalistic model). Tests passed.
Summary: Closes https://github.com/facebook/duckling/pull/119

Reviewed By: JonCoens

Differential Revision: D6597628

Pulled By: patapizza

fbshipit-source-id: 8bac0f686d6cecc38d9998e37042fe48f73530dc
2017-12-19 13:15:30 -08:00
Henri Dwyer
15b3988ec5 update MY pattern match to HashMap
Summary: Create hashmaps for the pattern matching rules, and make the regex matching read the value from the hashmap.

Reviewed By: patapizza

Differential Revision: D6592508

fbshipit-source-id: 0f4dd9bc548f71d0e6e52c938bd2e39bfd909c01
2017-12-18 13:00:35 -08:00
Henri Dwyer
10db72fd05 update KO pattern match to HashMap
Summary: Create hashmaps for the pattern matching rules, and make the regex matching read the value from the hashmap.

Reviewed By: panagosg7

Differential Revision: D6536790

fbshipit-source-id: ecb0bf28cf22b82ef10c3c2408eda15409189431
2017-12-15 11:45:28 -08:00
Julien Odent
fb3979d257 Numeral: move ruleFractions to common + cleanup numeral flag for Time
Summary:
* Closes PRs #115, #116.
* `Numeral`: Moves `ruleFractions` to common
* `Numeral/PT`: fixes dot in regex
* `Time`: Moves `isNumeralSafeToUse` to `isIntegerBetween` (more robust and cleaner)
* `Time/EN`: refactored `ruleCycleLastNextN` to `ruleDurationLastNext` (so it also accounts for non-safe Numerals, like "in a few days")

Reviewed By: blandinw

Differential Revision: D6502958

fbshipit-source-id: 6d9c08a23dab88f441aadade08d663c8e0da415d
2017-12-15 10:15:31 -08:00
Zahar Shimanchik
2274e40369 Added AmountOfMoney Dimension to Russian language
Summary: Closes https://github.com/facebook/duckling/pull/120

Reviewed By: patapizza

Differential Revision: D6520302

Pulled By: panagosg7

fbshipit-source-id: 2c9ac6e15ca3ee90b2bf5911ee62835966fcacd1
2017-12-12 12:15:30 -08:00