ES Numeral con

Summary:
In ES (Spanish), decimals can be expressed by `<number> con <number>`, where the whole part is to the left and the decimal part is to the right.

Resolves #615

Reviewed By: stroxler

Differential Revision: D28449722

fbshipit-source-id: caa0fb52f72f94c4a4cc456a46c25fa5f3b9b625
This commit is contained in:
Daniel Cartwright 2021-05-14 13:41:21 -07:00 committed by Facebook GitHub Bot
parent 323a7df023
commit 7762af850a
2 changed files with 2 additions and 2 deletions

View File

@ -42,7 +42,7 @@ allExamples =
, examples (NumeralValue 3_000_000) ["3M", "3000K", "3000000"]
, examples (NumeralValue 1_200_000) ["1200000", "1200K"]
, examples (NumeralValue (-1_200_000)) ["-1200000", "-1200K"]
, examples (NumeralValue 1.5) ["1 punto cinco", "una punto cinco"]
, examples (NumeralValue 1.5) ["1 punto cinco", "una punto cinco", "1 con cinco", "1 con 5"]
, examples (NumeralValue 1) ["cero uno", "zero uno"]
, examples (NumeralValue 2) ["cero dos", "zero dos"]
, examples (NumeralValue 3)

View File

@ -285,7 +285,7 @@ ruleNumeralMillionsAnd = Rule
ruleNumeralDotNumeral :: Rule
ruleNumeralDotNumeral = Rule
{ name = "number dot number"
, pattern = [dimension Numeral, regex "punto", Predicate $ not . hasGrain]
, pattern = [dimension Numeral, regex "(con|punto)", Predicate $ not . hasGrain]
, prod = \tokens -> case tokens of
(Token Numeral NumeralData { TNumeral.value = v1 } : _ : Token Numeral NumeralData { TNumeral.value = v2 } : _) ->
double $ v1 + decimalsToDouble v2