python-humanize / python-humanize/humanize

`intword` uses English units regardless of the active localization

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

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

help wanted
主要言語
Python
スター
756
フォーク
148
平均マージ
6日 1時間
マージ済み PR(30日)
12

説明

Not all languages group large numbers into A103 + B106, etc. For example, Japanese has no word for 106. Instead, it has a word for 104, and 106 is written as 100 of those. Unsurprisingly, 2e7 is not written 20 × 100 × 104, but as 2000 × 104. Translations should be able to specify which powers of 10 have special names.

What did you do?
>>> import humanize
>>> humanize.i18n.activate("ja_JP")
<gettext.GNUTranslations object at 0x102fcca00>
>>> humanize.intword(234909023)
'234.9 百万'
>>> humanize.intword(2349090)
'2.3 百万'
What did you expect to happen?
>>> humanize.intword(234909023)
'2.3億'
>>> humanize.intword(2349090)
'234.9万'
What actually happened?
>>> humanize.intword(234909023)
'234.9 百万'
>>> humanize.intword(2349090)
'2.3 百万'

(This is the equivalent of putting in 23490902 and getting "234.9 hundred thousand" in English)

What versions are you using?
  • OS: Fedora 39
  • Python: 3.12
  • Humanize: 4.9.0

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

humanize.i18n.activate で ja_JP を有効化した状態で、エントリーポイント humanize.intword から開始します。報告された日本語の出力を期待される 万 および 億 の形式と比較し、翻訳によってロケール固有の 10 の累乗の名称を提供する方法を決定します。例が期待される日本語の結果を生成し、英語の動作を変更しないことが完了の条件です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
localization
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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