mirror of
https://github.com/facebook/duckling.git
synced 2024-11-30 23:33:33 +03:00
Time: don't parse at + phone number
Summary: Fixes #95. Reviewed By: blandinw Differential Revision: D6129893 fbshipit-source-id: e863021
This commit is contained in:
parent
1ade1935b2
commit
980c0f279e
@ -90,6 +90,8 @@ negativeCorpus = (testContext, examples)
|
||||
, "rat 6"
|
||||
, "3 30"
|
||||
, "three twenty"
|
||||
, "at 650.650.6500"
|
||||
, "at 650-650-6500"
|
||||
]
|
||||
|
||||
allExamples :: [Example]
|
||||
|
@ -505,7 +505,7 @@ ruleHHMMLatent :: Rule
|
||||
ruleHHMMLatent = Rule
|
||||
{ name = "hhmm (latent)"
|
||||
, pattern =
|
||||
[ regex "((?:[01]?\\d)|(?:2[0-3]))([0-5]\\d)"
|
||||
[ regex "((?:[01]?\\d)|(?:2[0-3]))([0-5]\\d)(?!.\\d)"
|
||||
]
|
||||
, prod = \tokens -> case tokens of
|
||||
(Token RegexMatch (GroupMatch (hh:mm:_)):_) -> do
|
||||
|
@ -102,4 +102,5 @@ intersectTests = testCase "Intersect Test" $
|
||||
xs = [ ("tomorrow July", 2)
|
||||
, ("Mar tonight", 2)
|
||||
, ("Feb tomorrow", 1) -- we are in February
|
||||
, ("at 615.", 1) -- make sure ruleHHMMLatent allows this
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user