mirror of
https://github.com/facebook/duckling.git
synced 2024-11-30 23:33:33 +03:00
Add rulePrecision
Summary: about <distance> rule Reviewed By: haoxuany Differential Revision: D28389599 Pulled By: chessai fbshipit-source-id: 237f6f8ed605ba7d22f40cd338e637ed99565e28
This commit is contained in:
parent
1322cd69ec
commit
ff342868d7
@ -72,6 +72,7 @@ allExamples = concat
|
||||
[ "1.9 m"
|
||||
, "1.9米"
|
||||
, "米九"
|
||||
, "米九左右"
|
||||
]
|
||||
, examples (simple Metre 3.9)
|
||||
[ "3.9 m"
|
||||
|
@ -220,6 +220,19 @@ ruleIntervalBound2 = Rule
|
||||
_ -> Nothing
|
||||
}
|
||||
|
||||
rulePrecision :: Rule
|
||||
rulePrecision = Rule
|
||||
{ name = "about <distance>"
|
||||
, pattern =
|
||||
[ dimension Distance
|
||||
, regex "左右"
|
||||
]
|
||||
, prod = \case
|
||||
(t:_) -> Just t
|
||||
_ -> Nothing
|
||||
|
||||
}
|
||||
|
||||
rules :: [Rule]
|
||||
rules =
|
||||
[ ruleDistCentimeters
|
||||
@ -237,4 +250,5 @@ rules =
|
||||
, ruleIntervalDash
|
||||
, ruleIntervalBound
|
||||
, ruleIntervalBound2
|
||||
, rulePrecision
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user