Skip to content

Conversation

@blagasz
Copy link
Member

@blagasz blagasz commented Sep 28, 2025

Number spelling based on the pure Python implementation of the CLDR RBNF engine.

Currently only supports whole numbers (cardinal, ordinal, year) as fractional numbers are not well-defined and not universally implemented in CLDR.

Based on the original PR #660 with useful enhancements from @akx at #682 and additional work from the original author:

  • extensive test cases are generated
  • dataclass added to make parsing context more readable in code
  • linting and debugging including the removal of recursion errors

Extensive test cases are added, but should be considered smoke tests until a native speaker reviews them for each language.

Based on an earlier discussion: #114 and referenced in #179

Supersedes #682

@blagasz blagasz mentioned this pull request Sep 28, 2025
@codecov
Copy link

codecov bot commented Sep 28, 2025

Codecov Report

❌ Patch coverage is 97.88732% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.27%. Comparing base (50635d8) to head (bb56a15).

Files with missing lines Patch % Lines
babel/rbnf.py 97.83% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1232      +/-   ##
==========================================
+ Coverage   91.93%   92.27%   +0.33%     
==========================================
  Files          27       28       +1     
  Lines        4688     4972     +284     
==========================================
+ Hits         4310     4588     +278     
- Misses        378      384       +6     
Flag Coverage Δ
macos-14-3.10 91.15% <94.01%> (+0.17%) ⬆️
macos-14-3.11 91.31% <97.88%> (+0.39%) ⬆️
macos-14-3.12 91.51% <97.88%> (+0.38%) ⬆️
macos-14-3.13 91.51% <97.88%> (+0.38%) ⬆️
macos-14-3.8 91.02% <94.01%> (+0.18%) ⬆️
macos-14-3.9 91.08% <94.01%> (+0.17%) ⬆️
macos-14-pypy3.10 91.15% <94.01%> (+0.17%) ⬆️
ubuntu-24.04-3.10 91.17% <94.01%> (+0.17%) ⬆️
ubuntu-24.04-3.11 91.33% <97.88%> (+0.39%) ⬆️
ubuntu-24.04-3.12 91.53% <97.88%> (+0.38%) ⬆️
ubuntu-24.04-3.13 91.53% <97.88%> (+0.38%) ⬆️
ubuntu-24.04-3.8 91.04% <94.01%> (+0.18%) ⬆️
ubuntu-24.04-3.9 91.10% <94.01%> (+0.17%) ⬆️
ubuntu-24.04-pypy3.10 91.17% <94.01%> (+0.17%) ⬆️
windows-2022-3.10 91.16% <94.01%> (+0.17%) ⬆️
windows-2022-3.11 91.32% <97.88%> (+0.39%) ⬆️
windows-2022-3.12 91.52% <97.88%> (+0.38%) ⬆️
windows-2022-3.13 91.52% <97.88%> (+0.38%) ⬆️
windows-2022-3.8 91.13% <94.01%> (+0.17%) ⬆️
windows-2022-3.9 91.09% <94.01%> (+0.17%) ⬆️
windows-2022-pypy3.10 91.16% <94.01%> (+0.17%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@akx akx self-requested a review October 8, 2025 09:45
@akx akx added this to the Babel 2.19 milestone Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants