mirror of
https://github.com/facebook/duckling.git
synced 2024-08-17 17:20:55 +03:00
Add rulePrecision2
Summary: about <volume> Reviewed By: haoxuany Differential Revision: D28390051 Pulled By: chessai fbshipit-source-id: a357bbd15ab77578fda477eae6303158824458da
This commit is contained in:
parent
f10c4db112
commit
0a2ae7d895
@ -42,6 +42,7 @@ allExamples = concat
|
||||
, examples (simple Litre 0.5)
|
||||
[ "半公升"
|
||||
, "0.5L"
|
||||
, "0.5L左右"
|
||||
]
|
||||
, examples (simple Litre 0.25)
|
||||
[ "四分一升"
|
||||
@ -87,9 +88,13 @@ allExamples = concat
|
||||
[ "至少四ml"
|
||||
, "最少四毫升"
|
||||
, "四毫升或以上"
|
||||
, "起碼四毫升"
|
||||
]
|
||||
, examples (simple Millilitre 5)
|
||||
[ "一茶匙"
|
||||
, "三分一湯匙"
|
||||
]
|
||||
, examples (between Litre (60, 70))
|
||||
[ "六十到七十L"
|
||||
]
|
||||
]
|
||||
|
@ -79,6 +79,18 @@ rulePrecision = Rule
|
||||
_ -> Nothing
|
||||
}
|
||||
|
||||
rulePrecision2 :: Rule
|
||||
rulePrecision2 = Rule
|
||||
{ name = "about <volume> (second rule)"
|
||||
, pattern =
|
||||
[ dimension Volume
|
||||
, regex "左右"
|
||||
]
|
||||
, prod = \case
|
||||
(t:_) -> Just t
|
||||
_ -> Nothing
|
||||
}
|
||||
|
||||
ruleIntervalBetweenNumeral :: Rule
|
||||
ruleIntervalBetweenNumeral = Rule
|
||||
{ name = "between|from <numeral> and|to <volume>"
|
||||
@ -183,6 +195,7 @@ rules :: [Rule]
|
||||
rules = [ ruleUnitTeaspoon
|
||||
, ruleUnitSoupspoon
|
||||
, rulePrecision
|
||||
, rulePrecision2
|
||||
, ruleIntervalBetweenNumeral
|
||||
, ruleIntervalBetween
|
||||
, ruleIntervalMax
|
||||
|
Loading…
Reference in New Issue
Block a user