duckling/Duckling/Time
Steven Troxler 78904b6680 Time - #444 Handle 2-digit date in existing d/m/y rule
Summary:
The pattern laied out in the bug report
https://github.com/facebook/duckling/issues/444
is actually already handled by the pattern
`<day-of-month>(ordinal or number)/<named-month>/year`.

The problem is purely that the regular expression doesn't
match 2-digit years, so the pattern is getting skipped rather
than evaluated. This diff fixes the regexp and adds a new example
with a 2-digit pattern.

This fixes the bug report:
```
> debug (makeLocale EN Nothing) "10-Apr-15" [Seal Time]
<day-of-month>(ordinal or number)/<named-month>/year (10-Apr-15)
-- integer (numeric) (10)
-- -- regex (10)
-- regex (-)
-- April (Apr)
-- -- regex (Apr)
-- regex (-)
-- regex (15)
[Entity {dim = "time", body = "10-Apr-15", value = RVal Time (TimeValue (SimpleValue (InstantValue {vValue = 2015-04-10 00:00:00 -0200, vGrain = Day})) [SimpleValue (InstantValue {vValue = 2015-04-10 00:00:00 -0200, vGrain = Day})] Nothing), start = 0, end = 9, latent = False, enode = Node {nodeRange = Range 0 9, token = Token Time TimeData{latent=False, grain=Day, form=Nothing, direction=Nothing, holiday=Nothing, hasTimezone=False}, children = [Node {nodeRange = Range 0 2, token = Token Numeral (NumeralData {value = 10.0, grain = Nothing, multipliable = False, okForAnyTime = True}), children = [Node {nodeRange = Range 0 2, token = Token RegexMatch (GroupMatch ["10"]), children = [], rule = Nothing}], rule = Just "integer (numeric)"},Node {nodeRange = Range 2 3, token = Token RegexMatch (GroupMatch []), children = [], rule = Nothing},Node {nodeRange = Range 3 6, token = Token Time TimeData{latent=False, grain=Month, form=Just (Month {month = 4}), direction=Nothing, holiday=Nothing, hasTimezone=False}, children = [Node {nodeRange = Range 3 6, token = Token RegexMatch (GroupMatch []), children = [], rule = Nothing}], rule = Just "April"},Node {nodeRange = Range 6 7, token = Token RegexMatch (GroupMatch []), children = [], rule = Nothing},Node {nodeRange = Range 7 9, token = Token RegexMatch (GroupMatch ["15"]), children = [], rule = Nothing}], rule = Just "<day-of-month>(ordinal or number)/<named-month>/year"}}]
```

Reviewed By: chessai

Differential Revision: D27106007

fbshipit-source-id: 4751672aef807464febef87f6d22d7270bd335df
2021-03-17 10:35:00 -07:00
..
AR Add Arabic rule for a week ago (#379) 2021-01-29 11:32:32 -08:00
BG Add Time dimension for language BG 2020-01-10 14:34:22 -08:00
DA Duration/EN: Leverage TimeGrain for number.number hours 2019-12-11 12:38:17 -08:00
DE adds german time rule for expressions like: Montag in 3 Wochen (#332) 2021-02-09 14:33:37 -08:00
EL Duration/EN: Leverage TimeGrain for number.number hours 2019-12-11 12:38:17 -08:00
EN Time - #444 Handle 2-digit date in existing d/m/y rule 2021-03-17 10:35:00 -07:00
ES Fixed a problem in parsing mult-word timestamp for ES 2020-07-17 11:38:43 -07:00
FR Time/FR: Some speed up 2020-08-28 09:48:15 -07:00
GA Duration/EN: Leverage TimeGrain for number.number hours 2019-12-11 12:38:17 -08:00
HE Duration/EN: Leverage TimeGrain for number.number hours 2019-12-11 12:38:17 -08:00
HR Duration/EN: Leverage TimeGrain for number.number hours 2019-12-11 12:38:17 -08:00
HU Relicense to BSD3 2019-05-22 10:46:39 -07:00
IT Duration/EN: Leverage TimeGrain for number.number hours 2019-12-11 12:38:17 -08:00
KA ghc88x compat (#550) 2020-11-12 13:47:46 -08:00
KO Duration/EN: Leverage TimeGrain for number.number hours 2019-12-11 12:38:17 -08:00
NB Parse more date formats in Norwegian (#395) 2021-02-02 23:18:48 -08:00
NL Duration/EN: Leverage TimeGrain for number.number hours 2019-12-11 12:38:17 -08:00
PL Time/PL - new rules (#538) 2020-12-16 13:47:49 -08:00
PT Duration/EN: Leverage TimeGrain for number.number hours 2019-12-11 12:38:17 -08:00
RO implement 'the day after tomorrow' in Romanian 2021-01-29 14:49:13 -08:00
RU Add Time dimension for RU language 2021-02-12 12:02:44 -08:00
SV Duration/EN: Leverage TimeGrain for number.number hours 2019-12-11 12:38:17 -08:00
TimeZone Correct CDT TimeZone offset 2021-01-12 14:02:52 -08:00
UK Duration/EN: Leverage TimeGrain for number.number hours 2019-12-11 12:38:17 -08:00
VI Duration/EN: Leverage TimeGrain for number.number hours 2019-12-11 12:38:17 -08:00
ZH Time - add more common expressions 2021-02-04 16:32:11 -08:00
Computed.hs Time/EN_US: Super Tuesday 2020-03-02 10:48:07 -08:00
Corpus.hs Relicense to BSD3 2019-05-22 10:46:39 -07:00
Helpers.hs make duckling time not treat 0:xx and 12:xx ambiguously 2020-11-12 14:19:04 -08:00
HolidayHelpers.hs Translated all computed holidays from English into German and added HolidayHelpers to reduce code duplication. 2019-09-20 18:32:13 -07:00
Types.hs parse latent year intervals 2021-01-29 16:33:56 -08:00