Currency: some symbols aren't recognized as `mo`, and "200 €" in one `mn` is singular
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- rust
- 领域
- accessibility, backend
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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"?
- 主要语言
- Rust
- 星标
- 131
- 派生
- 97
- 平均合并
- 21 小时 45 分钟
- 30 天内合并 PR
- 95
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
daisy/MathCAT 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 84/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
相似的 Issue
-
area:schema documentation
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
ElectronicWave/Elemental#252 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
dekobon/big-code-analysis#1887 ·
维护者通常 1 天内回复
-
Shell中文符号输入异常未关闭bug
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复