Commit Graph

329 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Julien Odent
6df3b26707 Numeral: common rule + supporting hindu-arabic numerals for Burmese
Summary:
* `ruleIntegerNumeric` was used in all languages but Burmese.
* it seems like the hindu-arabic numerals are slowly getting in Burmese (e.g. recent car plates)
* Moving the rule in `Duckling/Numeral/Common.hs`

Reviewed By: blandinw

Differential Revision: D6498349

fbshipit-source-id: e868dc9960f18f0781e4aa98a0dfcd14969537c9
2017-12-06 16:00:28 -08:00
Alex Torres
498e8b16e6 fix pt rules for numeral
Summary:
When I write "dois mil e duzentos" the result should be 2200, but duckling recognize the numbers separated and give the result:

`[{"dim":"number","body":"dois","value":{"value":2,"type":"value"},"start":0,"end":4},{"dim":"number","body":"mil","value":{"value":1000,"type":"value"},"start":5,"end":8},{"dim":"time","body":"mil","value":{"values":[],"value":"1000-01-01T00:00:00.000-07:53","grain":"year","type":"value"},"start":5,"end":8},{"dim":"number","body":"duzentos","value":{"value":200,"type":"value"},"start":11,"end":19}]`

Now with this commit, duckling gives the correct result:

`[{"dim":"number","body":"dois mil e duzentos","value":{"value":2200,"type":"value"},"start":0,"end":19}]`
Closes https://github.com/facebook/duckling/pull/117

Reviewed By: blandinw

Differential Revision: D6477925

Pulled By: patapizza

fbshipit-source-id: 26ab503cc8def739c51ceb5bae7546016ba65ad6
2017-12-04 18:00:36 -08:00
Panagiotis Vekris
12a726aee7 Support for Greek times and dates
Summary:
This adds support for greek times.

There are still some issues with expressions of the form:
```
9:30 - 11:00 την πέμπτη
```
Where `11:00 την πέμπτη` is parsed first (as 11:30 on Thu), instead of prioritizing `9:30 - 11:00` as the training data suggests. These tests are for the moment excluded from the corpus.

Reviewed By: patapizza

Differential Revision: D6376271

fbshipit-source-id: 2f31e058fb88386429070e3b51cd33f93b9c5936
2017-12-04 16:45:40 -08:00
Julien Odent
fb10a6e6ba Time/EN: Parse spelled out times + AM/PM
Summary:
When using speech recognition, we might see things like "six thirty six a m" or
"ten thirty p m".
Also fixed the argument order of `timeOfDayAMPM` to be more idiomatic.

Reviewed By: blandinw

Differential Revision: D6316542

fbshipit-source-id: 0008c049040219b3a1dd80d9e4661ba8a246fa7f
2017-11-14 13:30:26 -08:00
Julien Odent
436e4662d9 Time/NL: don't be too eager on days of week
Summary:
"d" would parse as "dinsdag" (Tuesday), "zo" would parse as "zondag" (Sunday, also means "so").
Made dots mandatory, to prevent further issues (e.g. "zon" means "sun").

Reviewed By: mullender

Differential Revision: D6312693

fbshipit-source-id: 58c5824e3ff174fc9c293c3f2d13e152c60e51de
2017-11-13 09:00:40 -08:00
Panagiotis Vekris
fda8c7c759 Support Greek numerals
Summary:
- Setup Greek language (EL)
- Added Greek Numerals

Reviewed By: patapizza

Differential Revision: D6217873

fbshipit-source-id: 379170f
2017-11-02 17:16:18 -07:00
Julien Odent
f0a0c1e6b8 Time/EN: don't parse "this in 2 minutes" + fix thanksgiving in EN locales
Summary:
* add flag for this/next/last time
* fix thanskgiving in EN locales
* `analyzedRangeTest` helper with `rangeTests` for `Time/EN`

Reviewed By: blandinw

Differential Revision: D6191209

fbshipit-source-id: 6eaa117
2017-10-31 12:34:21 -07:00
Sam Pepose
251028e691 Uses correct date format for all EN locales
Summary: The date format changes between EN locales (https://en.wikipedia.org/wiki/Date_format_by_country). This diff fixes how dates are handled in each locale.

Reviewed By: patapizza

Differential Revision: D6156147

fbshipit-source-id: 22f296c
2017-10-26 08:49:21 -07:00