diff --git a/README.rst b/README.rst index c207324d..82c8e4ba 100644 --- a/README.rst +++ b/README.rst @@ -82,7 +82,7 @@ Besides the numerical argument, there are two main optional arguments, ``to:`` a * ``be`` (Belarusian) * ``ce`` (Chechen) * ``cy`` (Welsh) -* ``cz`` (Czech) +* ``cs`` (Czech) * ``de`` (German) * ``dk`` (Danish) * ``en_GB`` (English - Great Britain) diff --git a/num2words/__init__.py b/num2words/__init__.py index c513d853..934e09ff 100644 --- a/num2words/__init__.py +++ b/num2words/__init__.py @@ -18,7 +18,7 @@ from __future__ import unicode_literals from . import (lang_AM, lang_AR, lang_AZ, lang_BE, lang_CA, lang_CE, lang_CY, - lang_CZ, lang_DE, lang_DK, lang_EN, lang_EN_IN, lang_EN_NG, + lang_CS, lang_DE, lang_DK, lang_EN, lang_EN_IN, lang_EN_NG, lang_EO, lang_ES, lang_ES_CO, lang_ES_CR, lang_ES_GT, lang_ES_NI, lang_ES_VE, lang_FA, lang_FI, lang_FR, lang_FR_BE, lang_FR_CH, lang_FR_DZ, lang_HE, lang_HU, lang_ID, lang_IS, @@ -34,8 +34,8 @@ 'be': lang_BE.Num2Word_BE(), 'ca': lang_CA.Num2Word_CA(), 'ce': lang_CE.Num2Word_CE(), + 'cs': lang_CS.Num2Word_CS(), 'cy': lang_CY.Num2Word_CY(), - 'cz': lang_CZ.Num2Word_CZ(), 'en': lang_EN.Num2Word_EN(), 'en_IN': lang_EN_IN.Num2Word_EN_IN(), 'en_NG': lang_EN_NG.Num2Word_EN_NG(), diff --git a/num2words/lang_CZ.py b/num2words/lang_CS.py similarity index 99% rename from num2words/lang_CZ.py rename to num2words/lang_CS.py index 04c44a07..6024b77d 100644 --- a/num2words/lang_CZ.py +++ b/num2words/lang_CS.py @@ -84,7 +84,7 @@ } -class Num2Word_CZ(Num2Word_Base): +class Num2Word_CS(Num2Word_Base): CURRENCY_FORMS = { 'CZK': ( ('koruna', 'koruny', 'korun'), ('halíř', 'halíře', 'haléřů') diff --git a/tests/test_cz.py b/tests/test_cs.py similarity index 72% rename from tests/test_cz.py rename to tests/test_cs.py index 1801e8f7..2c2b0e5f 100644 --- a/tests/test_cz.py +++ b/tests/test_cs.py @@ -22,39 +22,39 @@ from num2words import num2words -class Num2WordsCZTest(TestCase): +class Num2WordsCSTest(TestCase): def test_cardinal(self): - self.assertEqual(num2words(100, lang='cz'), "sto") - self.assertEqual(num2words(101, lang='cz'), "sto jedna") - self.assertEqual(num2words(110, lang='cz'), "sto deset") - self.assertEqual(num2words(115, lang='cz'), "sto patnáct") - self.assertEqual(num2words(123, lang='cz'), "sto dvacet tři") - self.assertEqual(num2words(1000, lang='cz'), "tisíc") - self.assertEqual(num2words(1001, lang='cz'), "tisíc jedna") - self.assertEqual(num2words(2012, lang='cz'), "dva tisíce dvanáct") - self.assertEqual( - num2words(10.02, lang='cz'), + self.assertEqual(num2words(100, lang='cs'), "sto") + self.assertEqual(num2words(101, lang='cs'), "sto jedna") + self.assertEqual(num2words(110, lang='cs'), "sto deset") + self.assertEqual(num2words(115, lang='cs'), "sto patnáct") + self.assertEqual(num2words(123, lang='cs'), "sto dvacet tři") + self.assertEqual(num2words(1000, lang='cs'), "tisíc") + self.assertEqual(num2words(1001, lang='cs'), "tisíc jedna") + self.assertEqual(num2words(2012, lang='cs'), "dva tisíce dvanáct") + self.assertEqual( + num2words(10.02, lang='cs'), "deset celá nula dva" ) self.assertEqual( - num2words(15.007, lang='cz'), + num2words(15.007, lang='cs'), "patnáct celá nula nula sedm" ) self.assertEqual( - num2words(12519.85, lang='cz'), + num2words(12519.85, lang='cs'), "dvanáct tisíc pětset devatenáct celá osmdesát pět" ) self.assertEqual( - num2words(123.50, lang='cz'), + num2words(123.50, lang='cs'), "sto dvacet tři celá pět" ) self.assertEqual( - num2words(1234567890, lang='cz'), + num2words(1234567890, lang='cs'), "miliarda dvěstě třicet čtyři miliony pětset šedesát " "sedm tisíc osmset devadesát" ) self.assertEqual( - num2words(215461407892039002157189883901676, lang='cz'), + num2words(215461407892039002157189883901676, lang='cs'), "dvěstě patnáct quintillionů čtyřista šedesát jedna kvadriliard " "čtyřista sedm kvadrilionů osmset devadesát dva triliardy třicet " "devět trilionů dva biliardy sto padesát sedm bilionů sto " @@ -62,7 +62,7 @@ def test_cardinal(self): "devětset jedna tisíc šestset sedmdesát šest" ) self.assertEqual( - num2words(719094234693663034822824384220291, lang='cz'), + num2words(719094234693663034822824384220291, lang='cs'), "sedmset devatenáct quintillionů devadesát " "čtyři kvadriliardy dvěstě třicet čtyři " "kvadriliony šestset devadesát tři triliardy " @@ -75,40 +75,40 @@ def test_cardinal(self): def test_to_ordinal(self): # @TODO: implement to_ordinal with self.assertRaises(NotImplementedError): - num2words(1, lang='cz', to='ordinal') + num2words(1, lang='cs', to='ordinal') def test_currency(self): self.assertEqual( - num2words(10.0, lang='cz', to='currency', currency='EUR'), + num2words(10.0, lang='cs', to='currency', currency='EUR'), "deset euro, nula centů") self.assertEqual( - num2words(1.0, lang='cz', to='currency', currency='CZK'), + num2words(1.0, lang='cs', to='currency', currency='CZK'), "jedna koruna, nula haléřů") self.assertEqual( - num2words(1234.56, lang='cz', to='currency', currency='EUR'), + num2words(1234.56, lang='cs', to='currency', currency='EUR'), "tisíc dvěstě třicet čtyři euro, padesát šest centů") self.assertEqual( - num2words(1234.56, lang='cz', to='currency', currency='CZK'), + num2words(1234.56, lang='cs', to='currency', currency='CZK'), "tisíc dvěstě třicet čtyři koruny, padesát šest haléřů") self.assertEqual( - num2words(101.11, lang='cz', to='currency', currency='EUR', + num2words(101.11, lang='cs', to='currency', currency='EUR', separator=' a'), "sto jedna euro a jedenáct centů") self.assertEqual( - num2words(101.21, lang='cz', to='currency', currency='CZK', + num2words(101.21, lang='cs', to='currency', currency='CZK', separator=' a'), "sto jedna korun a dvacet jedna haléřů" ) self.assertEqual( - num2words(-12519.85, lang='cz', to='currency', cents=False), + num2words(-12519.85, lang='cs', to='currency', cents=False), "mínus dvanáct tisíc pětset devatenáct euro, 85 centů" ) self.assertEqual( - num2words(123.50, lang='cz', to='currency', currency='CZK', + num2words(123.50, lang='cs', to='currency', currency='CZK', separator=' a'), "sto dvacet tři koruny a padesát haléřů" ) self.assertEqual( - num2words(19.50, lang='cz', to='currency', cents=False), + num2words(19.50, lang='cs', to='currency', cents=False), "devatenáct euro, 50 centů" )