Commit Graph

754 Commits

Author SHA1 Message Date
Chinmay Deshmukh
9962e25845 Time/EN: "<day> in <duration>" should only operate on grain > Hour
Summary:
`today in one hour` was returning a time interval starting at 1 hr from now and ending at 2 hr from now.

The expected value is a single value one hour from now. This is accomplished by restricting `"<day> in <duration>"` to operaton only on durations with a grain > Hour

Reviewed By: patapizza

Differential Revision: D15055912

fbshipit-source-id: c3141eba358036577d2e14f0d588a99af83f62be
2019-04-24 11:46:35 -07:00
Noam Zilberstein
d6c9a0a95f add module header to TestMain.hs
Summary: Add a module header for more consistent style

Reviewed By: josefs

Differential Revision: D15046110

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

Reviewed By: chinmay87

Differential Revision: D14763094

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

Reviewed By: patapizza

Differential Revision: D14700060

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

Reviewed By: patapizza

Differential Revision: D14697405

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

Reviewed By: patapizza

Differential Revision: D14591780

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

Reviewed By: patapizza

Differential Revision: D14573637

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

Reviewed By: patapizza

Differential Revision: D14492291

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

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

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

Differential Revision: D14540169

Pulled By: patapizza

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

Reviewed By: chinmay87

Differential Revision: D14285746

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

Differential Revision: D14197864

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

Reviewed By: haoxuany, girifb

Differential Revision: D14195058

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

Differential Revision: D13878236

Pulled By: patapizza

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

Differential Revision: D14187742

Pulled By: patapizza

fbshipit-source-id: 301098d6ff1840e2715727a5d498f99d9ee3e037
2019-02-22 11:46:50 -08:00
Maurice Doepke
13031d10f5 fix travis build (#333)
Summary:
Fixes the travis build by raising the ghc version from 8.2.1 to 8.2.2 which according to the logs failed due to an ghc bug
Pull Request resolved: https://github.com/facebook/duckling/pull/333

Differential Revision: D14145462

Pulled By: patapizza

fbshipit-source-id: b734cf75d7b31e49503fc87dee0125455adedabe
2019-02-19 18:30:57 -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
Anne-Sylvie Deutsch
8b344b98cf Adding missing Dimensions.SW to duckling.cabal
Summary: Pull Request resolved: https://github.com/facebook/duckling/pull/318

Reviewed By: patapizza

Differential Revision: D13793955

Pulled By: chinmay87

fbshipit-source-id: 1fb717acf97b6b654b3c42645bf8baa7e68f6a7b
2019-01-24 15:00:57 -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
Julien Odent
b6878b1b64 Adding CreditCardNumber to README
Summary: as title

Reviewed By: haoxuany

Differential Revision: D13605870

fbshipit-source-id: dee587bef35b8a27fcc9a73d3a3114d18b2ce3ac
2019-01-09 10:31:11 -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
Julien Odent
49e0ffef04 Time/UK: Remove redundant pattern match
Summary: as title

Reviewed By: haoxuany

Differential Revision: D13553851

fbshipit-source-id: 3bf8b89f76c7567776b19e5bcf62160b2b110984
2019-01-02 12:45:55 -08:00
Martin Heuschober
36eda02097 add support for setting the port (#281)
Summary:
+ based on https://stackoverflow.com/a/51671356/630160 I have implemented:
    - passing in `--port=8080`
    - or setting PORT=8080 as environment variable
  where  `default < PORT < --port`, i.e. a --port parameter overrides both an environment variable and a default value, and an environment variable PORT overrides the default value.

+ change small hlint: `fromMaybe def . fmap f = `maybe def f`
Pull Request resolved: https://github.com/facebook/duckling/pull/281

Differential Revision: D13388735

Pulled By: patapizza

fbshipit-source-id: cbc4a819036dbec474526b862b0f6187f02b6155
2018-12-12 11:15:52 -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