mirror of
https://github.com/facebook/duckling.git
synced 2025-01-06 04:53:13 +03:00
Time/EN: Fix empty group match
Summary: sad_palpatine Differential Revision: D23718913 fbshipit-source-id: 363bf9a43d8d1cd77405882bc70a7fa1a1de2dbe
This commit is contained in:
parent
ef2b1b1b0e
commit
7ba9ea8aeb
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
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user