Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.maint.python > #15851
| From | Edward Betts <edward@4angle.com> |
|---|---|
| Newsgroups | linux.debian.bugs.dist, linux.debian.devel, linux.debian.maint.python |
| Subject | Bug#1071500: ITP: unicode-rbnf -- Rule-based number formatting using Unicode CLDR data |
| Date | 2024-05-20 11:10 +0200 |
| Message-ID | <IG7bP-eBcy-1@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Cross-posted to 3 groups.
Package: wnpp
Severity: wishlist
Owner: Edward Betts <edward@4angle.com>
X-Debbugs-Cc: debian-devel@lists.debian.org, debian-python@lists.debian.org
* Package name : unicode-rbnf
Version : 1.1.0
Upstream Author : Michael Hansen <mike@rhasspy.org>
* URL : https://github.com/rhasspy/unicode-rbnf
* License : MIT
Programming Lang: Python
Description : Rule-based number formatting using Unicode CLDR data
Provides a pure Python implementation of rule-based number formatting (RBNF)
using the Unicode Common Locale Data Repository (CLDR). This library allows
for the spelling out of numbers for a wide range of locales, supporting
various rulesets depending on the locale.
.
The library supports literal text, quotient and remainder substitution,
optional substitution, rule substitution, and special rules for negative
numbers, improper fractions, NaN, and infinity.
.
Example usage:
.
>>> from unicode_rbnf import RbnfEngine
>>> engine = RbnfEngine.for_language("en")
>>> engine.format_number(1234)
'one thousand two hundred thirty-four'
.
>>> from unicode_rbnf import RbnfEngine, RulesetName
>>> engine = RbnfEngine.for_language("en")
>>> engine.format_number(1999, RulesetName.YEAR)
'nineteen ninety-nine'
>>> engine.format_number(11, RulesetName.ORDINAL)
'eleventh'
.
This package is particularly useful for applications requiring accurate and
locale-aware number spelling, such as text-to-speech systems, financial
applications, and other linguistic tools.
I plan to maintain this package as part of the Python team.
Back to linux.debian.maint.python | Previous | Next | Find similar | Unroll thread
Bug#1071500: ITP: unicode-rbnf -- Rule-based number formatting using Unicode CLDR data Edward Betts <edward@4angle.com> - 2024-05-20 11:10 +0200
csiph-web