diff --git a/grammar/es/src/rules.rs b/grammar/es/src/rules.rs index 519b52c6..53830462 100644 --- a/grammar/es/src/rules.rs +++ b/grammar/es/src/rules.rs @@ -8,7 +8,7 @@ pub fn rules_percentage(b: &mut RuleSetBuilder) -> RustlingResult<()> b.rule_2(" per cent", number_check!(), // FIXME - b.reg(r#"(?:%|p\.c\.|por ?cien(?:tos?))?"#)?, + b.reg(r#"(?:%|p\.c\.|por ?cien(?:tos?)?)"#)?, |number, _| Ok(PercentageValue(number.value().value())) ); Ok(()) @@ -1321,13 +1321,13 @@ pub fn rules_time(b: &mut RuleSetBuilder) -> RustlingResult<()> { |_, duration| Ok(duration.value().clone().prefixed()) ); b.rule_2("exactly ", - b.reg(r#"(?:precis|exact)amente|justo"#)?, + b.reg(r#"(?:precis|exact)amente|(?:exact|just)o"#)?, duration_check!(), |_, duration| Ok(duration.value().clone().prefixed().precision(Precision::Exact)) ); b.rule_2(" exactly", duration_check!(), - b.reg(r#"(?:precis|exact)amente|justo"#)?, + b.reg(r#"(?:precis|exact)amente|(?:exact|just)o"#)?, |duration, _| Ok(duration.value().clone().prefixed().precision(Precision::Exact)) ); b.rule_2("approx ", @@ -1607,8 +1607,9 @@ pub fn rules_numbers(b: &mut RuleSetBuilder) -> RustlingResult<()> { ..IntegerValue::default() }) }); + // Warning! Es uses long scale, i.e. 1 billion = 1000 million b.rule_2("number millions", - integer_check_by_range!(1, 999), + integer_check_by_range!(1, 999999), b.reg(r#"mill[oóò]n(?:es)?"#)?, |a, _| { Ok(IntegerValue { @@ -1800,7 +1801,7 @@ pub fn rules_numbers(b: &mut RuleSetBuilder) -> RustlingResult<()> { } ); b.rule_1_terminal("ordinals 11-19", - b.reg(r#"d[eé]cimo? ?(primer|segund|tercer|cuart|quint|sext|s[eéè]ptim|octav|noven)(?:[oa]s?)?"#)?, + b.reg(r#"d[eé]cimo?s? ?(primer|segund|tercer|cuart|quint|sext|s[eéè]ptim|octav|noven)(?:[oa]s?)?"#)?, |text_match| { let value = match text_match.group(1).as_ref() { "primer" => 11,