Commit Graph

10 Commits

Author SHA1 Message Date
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
Julien Odent
bf89e34365 Relicense to BSD3
Reviewed By: JoelMarcey

Differential Revision: D15439223

fbshipit-source-id: c5af3cb06318748142fe503945b38beffadfc28a
2019-05-22 10:46:39 -07: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
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
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
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
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
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
fb1dcaa138 Chinese locales + fix TW National Day
Summary:
* Moving `ruleNationalDay` from `ZH` rules to specific locales: `zh_CN`, `zh_HK`, `zh_MO`
* Fixed National Day for `zh_TW`.

Reviewed By: blandinw

Differential Revision: D6057565

fbshipit-source-id: 8f9f2ab
2017-10-13 17:04:43 -07:00