Time/EN: Fix empty group match

Summary: sad_palpatine

Differential Revision: D23718913

fbshipit-source-id: 363bf9a43d8d1cd77405882bc70a7fa1a1de2dbe
This commit is contained in:
Julien Odent 2020-09-15 17:15:33 -07:00 committed by Facebook GitHub Bot
parent ef2b1b1b0e
commit 7ba9ea8aeb
14 changed files with 8052 additions and 7364 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -463,11 +463,11 @@ ruleMonthDOMNumeral = Rule
_ -> Nothing
}
ruleDOMOfMonth :: Rule
ruleDOMOfMonth = Rule
{ name = "<day-of-month> (ordinal or number) of <named-month>"
ruleTheDOMOfMonth :: Rule
ruleTheDOMOfMonth = Rule
{ name = "the <day-of-month> (ordinal or number) of <named-month>"
, pattern =
[ regex "(the)?"
[ regex "the"
, Predicate isDOMValue
, regex "of|in"
, Predicate isAMonth
@ -477,6 +477,19 @@ ruleDOMOfMonth = Rule
_ -> Nothing
}
ruleDOMOfMonth :: Rule
ruleDOMOfMonth = Rule
{ name = "<day-of-month> (ordinal or number) of <named-month>"
, pattern =
[ Predicate isDOMValue
, regex "of|in"
, Predicate isAMonth
]
, prod = \tokens -> case tokens of
(token:_:Token Time td:_) -> Token Time <$> intersectDOM td token
_ -> Nothing
}
ruleDOMMonth :: Rule
ruleDOMMonth = Rule
{ name = "<day-of-month> (ordinal or number) <named-month>"
@ -2621,6 +2634,7 @@ rules =
, ruleMonthDOMNumeral
, ruleDOMMonth
, ruleDOMOfMonth
, ruleTheDOMOfMonth
, ruleDOMOrdinalMonthYear
, ruleDOMMonthYear
, ruleIdesOfMonth