Add rulePrecision

Summary: about <distance> rule

Reviewed By: haoxuany

Differential Revision: D28389599

Pulled By: chessai

fbshipit-source-id: 237f6f8ed605ba7d22f40cd338e637ed99565e28
This commit is contained in:
kcnhk1@gmail.com 2021-05-12 13:22:58 -07:00 committed by Facebook GitHub Bot
parent 1322cd69ec
commit ff342868d7
2 changed files with 15 additions and 0 deletions

View File

@ -72,6 +72,7 @@ allExamples = concat
[ "1.9 m"
, "1.9米"
, "米九"
, "米九左右"
]
, examples (simple Metre 3.9)
[ "3.9 m"

View File

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