Add rulePrecision2

Summary: about <volume>

Reviewed By: haoxuany

Differential Revision: D28390051

Pulled By: chessai

fbshipit-source-id: a357bbd15ab77578fda477eae6303158824458da
This commit is contained in:
kcnhk1@gmail.com 2021-05-12 16:41:01 -07:00 committed by Facebook GitHub Bot
parent f10c4db112
commit 0a2ae7d895
2 changed files with 18 additions and 0 deletions

View File

@ -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"
]
]

View File

@ -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