mirror of
https://github.com/bblaz/num2words.git
synced 2025-12-05 22:32:25 +00:00
Merge branch 'master' into master
This commit is contained in:
15
CHANGES.rst
15
CHANGES.rst
@@ -1,6 +1,21 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
Version 0.5.12 -- 2022/08/19
|
||||
----------------------------
|
||||
|
||||
* Support Japanese Reiwa (令和/れいわ) era. (#412)
|
||||
* Add basic farsi support (#354)
|
||||
* Added Tajik language support (#406)
|
||||
* Fix Amharic language support (#465)
|
||||
* Fix Hebrew pluralize and implement to_currency (#330)
|
||||
* Add support to translate some currencies in italian language (#434)
|
||||
* Fix Polish twenties (#345)
|
||||
* Add uzs for ru and en (#422)
|
||||
* Added support for Esperanto numbers. (#387)
|
||||
* [ADD] to ordinal number for Turkish (#468)
|
||||
* Fix zeroth in Dutch to nulde fixing (#326)
|
||||
|
||||
Version 0.5.11 -- 2022/08/03
|
||||
----------------------------
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ import sys
|
||||
from docopt import docopt
|
||||
import num2words
|
||||
|
||||
__version__ = "0.5.11"
|
||||
__version__ = "0.5.12"
|
||||
__license__ = "LGPL"
|
||||
|
||||
|
||||
|
||||
@@ -76,7 +76,10 @@ class Num2Word_NL(Num2Word_EU):
|
||||
"zes", "vijf", "vier", "drie", "twee", "één",
|
||||
"nul"]
|
||||
|
||||
self.ords = {"één": "eerst",
|
||||
# Wiktionary says it is "nulde", not "nulte" or "nule"
|
||||
# https://en.wiktionary.org/wiki/nulde
|
||||
self.ords = {"nul": "nuld",
|
||||
"één": "eerst",
|
||||
"twee": "tweed",
|
||||
"drie": "derd",
|
||||
"vier": "vierd",
|
||||
|
||||
@@ -806,6 +806,10 @@ class Num2Word_TR(Num2Word_Base):
|
||||
|
||||
return wrd
|
||||
|
||||
def to_ordinal_num(self, value):
|
||||
self.verify_ordinal(value)
|
||||
return "%s%s" % (value, self.to_ordinal(value)[-4:])
|
||||
|
||||
def to_splitnum(self, val):
|
||||
float_digits = str(int(val * 10 ** self.precision))
|
||||
if not int(val) == 0:
|
||||
|
||||
@@ -36,6 +36,7 @@ class Num2WordsNLTest(TestCase):
|
||||
)
|
||||
|
||||
def test_ordinal_at_crucial_number(self):
|
||||
self.assertEqual(num2words(0, ordinal=True, lang='nl'), "nulde")
|
||||
self.assertEqual(num2words(100, ordinal=True, lang='nl'), "honderdste")
|
||||
self.assertEqual(
|
||||
num2words(1000, ordinal=True, lang='nl'), "duizendste"
|
||||
|
||||
@@ -182,7 +182,11 @@ class Num2WordsTRTest(TestCase):
|
||||
{"test": 101101011010.02, "to": "cardinal",
|
||||
"expected": u"yüzbirmilyaryüzbirmilyononbirbinonvirgüliki"},
|
||||
{"test": 101101011010.2, "to": "cardinal",
|
||||
"expected": u"yüzbirmilyaryüzbirmilyononbirbinonvirgülyirmi"}
|
||||
"expected": u"yüzbirmilyaryüzbirmilyononbirbinonvirgülyirmi"},
|
||||
{"test": 10, "to": "ordinal_num", "expected": u"10uncu"},
|
||||
{"test": 1, "to": "ordinal_num", "expected": u"1inci"},
|
||||
{"test": 3, "to": "ordinal_num", "expected": u"3üncü"},
|
||||
{"test": 6, "to": "ordinal_num", "expected": u"6ıncı"}
|
||||
]
|
||||
|
||||
for casedata in testcases:
|
||||
|
||||
Reference in New Issue
Block a user