Commit Graph

35 Commits

Author SHA1 Message Date
Alex Kapranoff
30b3d29e86 (Time/TimeGrain/Ordinal)/RU_XX: several extra Time forms for Russian
Summary:
Some changes were originally suggested by me during the review of
https://github.com/facebook/duckling/pull/474.
Others are new.

1. "Day after tomorrow/before yesterday"
2. Ordinals in the form of number+suffix like "8th of March"
3. Tuesdays require a special preposition.
4. Support "Yo" (U+0451) in "fourth" and "during daylight".
5. Support special perposition for "next week".
6. Support "one before last" adjective for time grains.
7. Proper suffixes for "quarter" grain.
8. Support "at midnight".
9. Support alternative flag for "afternoon".

Changes in Ordinal and TimeGrain are all driven by the new examples in the
corpus for Time.

There are also a couple of bugfixes:
1. A hidden latin "e" was present in an otherwise Cyrillic regex.
2. Wrong order of options in a regex separated with "|" prevented some matches.

Reviewed By: haoxuany

Differential Revision: D32311714

fbshipit-source-id: 084f6c3893eb5bfd767c267f558b910c6854eb59
2021-11-30 09:49:43 -08:00
Ovidiu Nistor
dd70d80dc1 Add Japanese time dimension (#646)
Summary:
Add the most common rules for Japanese time dimension.

Pull Request resolved: https://github.com/facebook/duckling/pull/646

Reviewed By: stroxler

Differential Revision: D30675005

Pulled By: chessai

fbshipit-source-id: 917aa98b5cfe0c73d207b1f51b80d8e17a1c7e6a
2021-09-21 12:28:06 -07:00
leandro.guisandez@pgconocimiento.com
f10c4db112 Init
Summary: Initialise TimeGrain for CA (Catalan) language

Reviewed By: stroxler

Differential Revision: D28299113

Pulled By: chessai

fbshipit-source-id: ffcd4043554123f5de2d279ef2660db83eb9f475
2021-05-12 16:33:51 -07:00
Steven Troxler
f73277c2b0 Duration/EN: fix lint errors
Summary:
Minor changes to silence most linter errors
- remove redundant import
- delete some redundant brackets and tweak bracket locations
- switch . to $ to avoid excessive-point-free-style warnings

Also linted Duration/Types.hs

Reviewed By: chessai

Differential Revision: D27891440

fbshipit-source-id: d84287edafe328aeddd78b781618ec5c41944bd8
2021-04-21 13:32:37 -07:00
Mustafa ALP
3157d2e553 Time Dimension for TR locale (#584)
Summary:
Added time dimension for Turkish language

Pull Request resolved: https://github.com/facebook/duckling/pull/584

Differential Revision: D27235743

Pulled By: chessai

fbshipit-source-id: 7419ff7373d942530f0eb35939acb9970b918672
2021-04-06 10:32:18 -07:00
kckckcng
a82684e723 Time&Duration/ZH: support Cantonese and more common expressions (#516-2) (#523)
Summary:
**2nd set of changes from pull request https://github.com/facebook/duckling/issues/516

Supporting Cantonese and more common expressions in Chinese.
Adding rules file for Duration/ZH.

Pull Request resolved: https://github.com/facebook/duckling/pull/523

Reviewed By: haoxuany

Differential Revision: D23428901

Pulled By: chessai

fbshipit-source-id: 6d04c97b63bac966eb61d77cab2f08f7543dbbf0
2021-01-26 15:17:45 -08:00
Dmitri Osipov
e7264b55c9 adds frequent durations in German (#509)
Summary:
Found a lacking frequent duration in German and a small typo in the existing one.

Pull Request resolved: https://github.com/facebook/duckling/pull/509

Reviewed By: patapizza

Differential Revision: D24690104

Pulled By: chessai

fbshipit-source-id: b49a7a636abf5b92f2fe7c0d5b2ca2fe64acbaa2
2020-11-09 11:18:35 -08:00
David Whitney
0ebaf378dc Duration/EN: parse Xm as X minutes and X.Y hrs as X.Y hours
Summary: modified the regex pattern for minutes to include m alone, as well as the regex pattern for ruleDurationDotNumeralHours to pass h, hr, and hrs

Reviewed By: patapizza

Differential Revision: D18799727

fbshipit-source-id: df4d0bd53407b427254169454e647e43e073795e
2019-12-06 08:47:51 -08: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
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
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
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
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
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
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
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
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
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
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
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
igor-drozdov
29d776dee5 Added TimeGrain and Duration Dimensions to Russian language
Summary:
- Added Duration dimension to Russian language
- Added TimeGrain dimension to Russian language
- Refactored isNatural and isNaturalWith out of Duration helpers into Numeral helpers
- Implemented <integer> and a half rule for Russian Numeral
- Changed the type of inSeconds to polymorphic one
Closes https://github.com/facebook/duckling/pull/105

Reviewed By: blandinw

Differential Revision: D6312604

Pulled By: patapizza

fbshipit-source-id: 9ae237b4beb6915ff8da013230457937d8e56733
2017-11-15 10:45:24 -08:00
Panagiotis Vekris
e8937e1cd6 Support for Greek durations
Summary: Adding support for Greek time grains and durations.

Reviewed By: patapizza

Differential Revision: D6249955

fbshipit-source-id: 1c69e26
2017-11-06 18:49:36 -08:00
Matthijs Mullender
1ade1935b2 Support Dutch dates and times
Summary: [Duckling][Time][NL] Support Dutch dates and times

Reviewed By: patapizza

Differential Revision: D6090294

fbshipit-source-id: 54b8729
2017-10-19 14:04:38 -07:00
Abdallatif Sulaiman
18cd2210ac Add Duration Dimension to Arabic Language
Summary: Closes https://github.com/facebookincubator/duckling/pull/94

Reviewed By: blandinw

Differential Revision: D6078221

Pulled By: patapizza

fbshipit-source-id: b653b24
2017-10-17 16:04:28 -07:00
Matthijs Mullender
33a08bb76b Support Dutch Durations
Summary:
This change adds support for durations in Dutch/Netherlands (NL)
Implemented: TimeGrain/NL, Durations/NL

Reviewed By: patapizza

Differential Revision: D6049404

fbshipit-source-id: 3621cdb
2017-10-13 12:49:30 -07:00
Julien Odent
83ea150d94 Convert back escaped characters in rules
Summary:
We noticed that using UTF-8 characters directly in regexes work.
Hence converting back the escaped characters for readability and maintenance.

Reviewed By: blandinw

Differential Revision: D5787146

fbshipit-source-id: e5a4b9a
2017-09-07 12:49:33 -07:00
Fredrik Wallén
9b5b7bc6ce Corrected ordinals for Swedish and updated tests accordingly
Summary:
There are problems in the ordinal recognition for Swedish. The most severe one is that all the numbers above 15 are actually Danish, not Swedish. Apart from that digits and digits followed by a dot are considered ordinals.

This pull request fixes this and also adds support for ordinals up to 100. The structure of the code is similar to in the ordinal recognition in English. Tests are also updated, both the ordinal tests and the time tests where incorrect ordinals were used.
Closes https://github.com/facebookincubator/duckling/pull/86

Reviewed By: JonCoens

Differential Revision: D5698145

Pulled By: patapizza

fbshipit-source-id: c31d7bc
2017-08-25 17:04:29 -07:00
dubovinszky
60565c15aa HU Time, TimeGrain
Summary: Closes https://github.com/facebookincubator/duckling/pull/83

Reviewed By: blandinw

Differential Revision: D5681515

Pulled By: patapizza

fbshipit-source-id: 918d0a4
2017-08-22 19:34:33 -07:00
Julien Odent
7a6c2597af Time: don't shift duration on <duration> before/after <time> (but now)
Summary:
* `Duration` before/after `Time` now resolves with the lowest grain
* "now" has an undefined grain `NoGrain`, as depending on the context it might mean different things, as opposed to "right now"

Before:
`day after tomorrow` -> `day` grain
`1 day after tomorrow` -> `hour` grain

Given that the reference date/time is `2013-02-12T04:30:00`.
`one year from now` -> `2014-02-01T00:00:00` with `month` grain.
`one year from today` -> `2014-02-01T00:00:00` with `month` grain.

After:
`day after tomorrow` -> `day` grain
`1 day after tomorrow` -> `day` grain
`one year from now` -> `2014-02-12T04:30:00` with `month` grain (remains the same).
`one year from today` -> `2014-02-12T00:00:00` with `day` grain.

For other `Time` entities involving `Duration`, such as "in + `Duration`", the behavior remains the same: shift to the lower grain (the intent is not precise).

Reviewed By: l5t, blandinw

Differential Revision: D5467164

fbshipit-source-id: b63b6a4
2017-07-26 11:49:44 -07:00
Şeref R.Ayar
b69874cd9f Duration for TR
Summary: Closes https://github.com/facebookincubator/duckling/pull/32

Reviewed By: niteria

Differential Revision: D5150778

Pulled By: patapizza

fbshipit-source-id: d156b0a
2017-05-31 02:19:40 -07:00
kkpoon
001ff291fc Add Cantonese support to date time into ZH
Summary:
Add the [Cantonese](https://en.wikipedia.org/wiki/Cantonese) (the official spoken language used in Hong Kong) support to date time

- updated Duration ZH corpus
- updated Time ZH rules and corpus
- updated TimeGrain ZH rules
Closes https://github.com/facebookincubator/duckling/pull/24

Reviewed By: patapizza

Differential Revision: D5143947

Pulled By: niteria

fbshipit-source-id: 9107d05
2017-05-30 07:49:19 -07:00
Julien Odent
432ff51bd0 VI: TimeGrain
Summary: TimeGrain dimension for Vietnamese.

Reviewed By: niteria

Differential Revision: D4959399

fbshipit-source-id: e053413
2017-04-28 08:04:21 -07:00
Julien Odent
1c15d0bbb2 TimeGrain
Summary: TimeGrain dimension for Croatian.

Reviewed By: niteria

Differential Revision: D4947837

fbshipit-source-id: b86d256
2017-04-26 09:19:27 -07:00
Julien Odent
efa38401b5 TimeGrain
Summary: TimeGrain dimension for Hebrew.

Reviewed By: niteria

Differential Revision: D4930294

fbshipit-source-id: 9c0f0da
2017-04-24 06:49:40 -07:00
FBShipIt
3f8e52e70a Initial commit
fbshipit-source-id: 301a10f448e9623aa1c953544f42de562909e192
2017-03-08 10:33:56 -08:00