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

未关闭
#991 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
rust

调研方向

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 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

daisy/MathCAT 的其他 Issue

查看 daisy/MathCAT 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。