Currency: some symbols aren't recognized as `mo`, and "200 €" in one `mn` is singular

Abierto
#991 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust

Línea de trabajo

Start with src/canonicalize.rs and inspect the fixed currency symbol list and the handling of symbols inside mn tokens. Then trace the currency rules and UnitNumber behavior for the English and Spanish examples, and find the related tests before changing anything. Done means the listed symbol and amount cases produce the expected speech, with the decimal question resolved by the relevant behavior and tests.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Found while checking Spanish currencies (examples in English unless noted).

1. Symbols missing from is_currency_symbol. src/canonicalize.rs has a fixed list, so ¥, ₲, ₽ and ₴ written as <mo> aren't treated as currency:

input speech expected
<mo>¥</mo><mn>200</mn> yen 200 200 yen
<mn>200</mn><mo>¥</mo> 200 yen 200 yen (es: 200 yenes)
<mo>₲</mo><mn>200</mn> guaranis 200 200 guaranis
<mo>₽</mo><mn>200</mn> ₽ 200 200 rubles

With <mi> they work when the language lists them in CurrencySymbols. Maybe is_currency_symbol could use the language's CurrencySymbols instead of a fixed list; otherwise, adding ¥ ₲ ₽ ₴ would cover these.

2. Amount and symbol in one mn. <mn>200 €</mn> is split into ⁢ <mn>200 </mn> ⁢ <mi>€</mi>: an extra invisible times at the start and a trailing space in the number. Then the currency rules don't match:

input en es
<mn>200 €</mn> 200 euros 200 euro
<mn>1 €</mn> 1 euros 1 euro (should be "un euro")
<mn>€200</mn> 200 euros 200 euros

3. A small question. <mn>1,0</mn><mo>€</mo> in Spanish says "un euro"; with decimals Spanish normally uses the plural ("1,0 euros"), as English does ("1.0 euros"). Is UnitNumber meant to treat 1,0 as "one"?

Lenguaje dominante
Rust
Estrellas
131
Forks
97
Merge medio
21 h 45 min
PR fusionados (30 d)
95

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de daisy/MathCAT

Todos los issues de daisy/MathCAT

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.