Summary: Add Boss's Day (closest working day to Oct 16) in EN
Reviewed By: patapizza
Differential Revision: D7512241
fbshipit-source-id: c8a4a14b77677ed34edebfeb48bfce1019bb059d
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
Summary: Add EN support for this|last|next season
Reviewed By: patapizza
Differential Revision: D7443814
fbshipit-source-id: 925296f793fbe03bcb67d8a6af3eb6695347eedd
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
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
Summary: Add EN support for last night and late last night
Reviewed By: patapizza
Differential Revision: D7369829
fbshipit-source-id: bd1dbecf247e428307adfae3e8e83840f6de77b1
Summary: Added rules for the beginning / end of year / month / week
Reviewed By: patapizza
Differential Revision: D7356994
fbshipit-source-id: 43489b3709b8ab586384321cf9bc79c45668162a
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
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
Summary: Support lowercase time zones
Reviewed By: patapizza
Differential Revision: D7114137
fbshipit-source-id: 906c4fa5305aea8990e8a5d480ceeec4b584d7db
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
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
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
Summary:
* Locales support for the library, following `<Lang>_<Region>` with ISO 639-1 code for `<Lang>` and ISO 3166-1 alpha-2 code for `<Region>` (#33)
* `Locale` opaque type (composite of `Lang` and `Region`) with `makeLocale` smart constructor to only allow valid `(Lang, Region)` combinations
* API: `Context`'s `lang` parameter has been replaced by `locale`, with optional `Region` and backward compatibility.
* `Rules/<Lang>.hs` exposes
- `langRules`: cross-locale rules for `<Lang>`, from `<Dimension>/<Lang>/Rules.hs`
- `localeRules`: locale-specific rules, from `<Dimension>/<Lang>/<Region>/Rules.hs`
- `defaultRules`: `langRules` + specific rules from select locales to ensure backward-compatibility
* Corpus, tests & classifiers
- 1 classifier per locale, with default classifier (`<Lang>_XX`) when no locale provided (backward-compatible)
- Default classifiers are built on existing corpus
- Locale classifiers are built on
- `<Dimension>/<Lang>/Corpus.hs` exposes a common `corpus` to all locales of `<Lang>`
- `<Dimension>/<Lang>/<Region>/Corpus.hs` exposes `allExamples`: a list of examples specific to the locale (following `<Dimension>/<Lang>/<Region>/Rules.hs`).
- Locale classifiers use the language corpus extended with the locale examples as training set.
- Locale examples need to use the same `Context` (i.e. reference time) as the language corpus.
- For backward compatibility, `<Dimension>/<Lang>/Corpus.hs` can expose also `defaultCorpus`, which is `corpus` augmented with specific examples. This is controlled by `getDefaultCorpusForLang` in `Duckling.Ranking.Generate`.
- Tests run against each classifier to make sure runtime works as expected.
* MM/DD (en_US) vs DD/MM (en_GB) example to illustrate
Reviewed By: JonCoens, blandinw
Differential Revision: D6038096
fbshipit-source-id: f29c28d