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

オープン
#991 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
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分
マージ済み PR(30日)
95

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

daisy/MathCAT のほかの issue

daisy/MathCAT の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。