263 Commits

Author SHA1 Message Date
siikamiika
8820681169 add support for Finnish (FI) (#170)
FI: Add support for Finnish

This is a squash of the following commits :

* The recommendation by Kotus was optional. The code didn't work anyway
because million is 10**6, not 10**9, and the recommendation only applies
to round millions, billions and so on where the multiplier is 10 or
greater.
* FI: currency: use inheritance, add FIM and USD
* FI: add some common currencies
* FI: add inflections
* FI: inflections: small fixes
* FI: fix ordinal 200
* FI: fix comitative
* FI: actually fix ordinal 200
* FI: refactoring
* FI: fix tens
* FI: fix plural for tens and higher
* FI: toinen --> kahdes for numbers > 200
* FI: use collection for options
* FI: add tests
* FI: add minced tests
* FI: trim tests
* FI: finishing touches
* FI: improve cardinal_float, ordinal, add tests
* FI: add documentation to README.rst
2018-06-22 10:00:49 -04:00
siikamiika
89554ff9e2 add support for Japanese (JA) (#171)
* add support for Japanese (JA)
2018-06-15 11:14:56 -04:00
Abraham Anes
b492530cfa Change implementation of to_currency() in es_ES (#167)
* Change implementation of to_currency()
* Change OLD to ESP and add USD
2018-04-18 09:05:13 -04:00
dede64
551a980e54 Created translation to Czech language (#154)
* Create lang_CZ.py

* Added czech language to init .

* Update __init__.py

* Update lang_CZ.py

* Added translation to czech language

* Fixed thousands translation

* Added czech language to readme

* Changed pointword in czech translation.

* Create test_cz.py

* Fixed names for very big numbers.

* Fixed currency spelling.

* Created tests for czech language.

* Fixed: Shortened length of some long lines.

* Shortened one more line of code.

* Fixed tests

* Fixed flake-8.

* Changed name of the test class
2018-02-19 16:30:20 -05:00
François Honoré (Acsone)
ce21cb9f18 [ADD] Add lang fr_BE + tests (#151) 2018-01-16 14:38:43 -05:00
Antonio Gurgel
1a2b783d31 lang_EN.to_year(): render correct pronunciations (#144)
* Add tests

Starting work on #141, which points out that 2017 should come out
"twenty seventeen"; it currently comes out "two thousand seventeen".

* Handle English years properly.

Resolves #141.

* Whoops -- didn't PEP-8 my tests

* Handle years MORE properly...with suffixes!

- Rendering years between 10-99 was bugged (e.g. "zero fifty").
Fixed that by thinking outside the high/low text box I had made.
- Added suffixes: default none if positive, 'BC' if negative.
User-overrideable.
2017-12-18 10:56:38 -05:00
pipech
ab54bed93a add Thai Language from Thailand (#139)
* add Thai

* change splitby3 to splitbyx

* change lang_th to use function from currency

* make Num2Word_TH inherit from Num2Word_Base

* comment out test failed in 2.7 env

* fix python2.7 error

* add USD EUR for Thai

* pep8 fix

* added Thai
2017-12-14 11:48:12 -05:00
Carli Samuele
efce631944 Fix lang_IT handling of floats (#143)
`n % 1 != 0` is not a valid test for float:

In []: 1.1 % 1 == 0
Out[]: False

but:

In []: 1.0 % 1 == 0
Out[]: True

hence it's really necessary to explicitly test for type in this case.
2017-12-04 17:16:06 -05:00
Ernesto Rodriguez Ortiz
9819498a14 Increase test coverage for lang fr* (#136)
Ref: issues #116 #121 #127
2017-11-09 10:15:29 -05:00
Mārtiņš Šulcs
1e954c909b Attempt at refactoring to_currency into base (#135)
* Attempt at refactoring lv to base

* Remove dead files.

* Use static props.

* Convert doctests, move utils out.

* Refactor lt

* Update and move ru doctests.

* Refactor ru.

* Refactor pl.

* Move uk doctests.

* Refactor uk.

* DRY

* Cleanup.
2017-11-09 10:13:01 -05:00
Ernesto Rodriguez Ortiz
1c699d1bb4 Fix bugs in the float precision and the currency, increase test coverage (#134)
* Fix some bugs in the float precision and the currency, increase test coverage.

Ref: issue #112 #113

* Update README.rst
2017-11-06 20:19:26 -05:00
Mārtiņš Šulcs
5a131fedc6 Long form for currency name is optional. Currency name rendering in e… (#133)
* Long form for currency name is optional. Currency name rendering in english.

* Missing encoding header.
2017-11-05 17:59:25 -05:00
Mārtiņš Šulcs
a1a3c53b39 Improve lv (#132)
* Add legal form.

* Fix fractions (comma)

* Fix edge case, improve test coverage.

* Add most popular currencies

* PEP8 line length

* Fix some forms.
2017-11-01 13:04:09 -04:00
Mārtiņš Šulcs
f9d8868794 Refactor and fix some issues with to_currency. Reduce code duplication. (#129)
* Refactor and fix some issues with to_currency. Reduce code duplication.

* Use unicode literals in uk testcase.
2017-10-31 20:17:13 -04:00
Ernesto Rodriguez Ortiz
3da0c54f3b Activate flake8, isort and coveralls in the configuration of tox (#105)
* Activate flake8, isort and coveralls in the configuration of tox

* Update code to respect PEP8

* Fix bug in the lang_IT for python 3

* Update the README to include the new converters.
2017-10-30 14:06:46 -04:00
Blaž Bregar
2ee0e49a8b Added Slovene 2017-10-22 18:06:49 +02:00
Armin Oliya
d96175b58e Merge branch 'master' into master 2017-09-20 14:35:27 +02:00
Sergio Zholudov
28f3d3bcff update uk_test (utf-8 issue resolved) 2017-09-11 15:05:11 +03:00
Sergio Zholudov
23b1961fe5 updated test_uk 2017-09-11 14:32:16 +03:00
Sergio Zholudov
865a311437 Ukrainian language test update 2017-09-11 13:48:18 +03:00
Sergio Zholudov
88eb77c927 update test_uk.py 2017-09-11 13:40:56 +03:00
Sergio Zholudov
b93c716597 update test_uk 2017-09-11 13:38:00 +03:00
Sergio Zholudov
279b63ed50 update test_uk 2017-09-11 13:01:59 +03:00
Sergio Zholudov
90b85a366c Tests Ukrainian language 2017-09-11 12:43:30 +03:00
Armin
7fe315eb64 fixed bug with 12 and 11 2017-09-08 17:54:25 +02:00
Armin
63fe589b98 fixed test bug 2017-09-08 17:47:23 +02:00
Armin
294d350fb9 added NL test cases 2017-09-08 17:42:30 +02:00
Jesús Leganés-Combarro 'piranna
614255bbde Add fr_DZ locale 2017-09-05 22:43:21 +02:00
Jesús Leganés-Combarro 'piranna
29d9d2a336 Converted tabs indention to spaces 2017-09-05 22:36:37 +02:00
Tufan Kaynak
c3cec93c4d correction of 0.0n reading 2017-09-05 14:50:32 +03:00
Tufan Kaynak
a235058ba6 refactoring data elements 2017-09-02 14:22:50 +03:00
Tufan Kaynak
a659e63eb5 TR translation
TR translation of num2word reading all cardinals and ordinals up to 10**21-1
2017-08-30 19:36:29 +03:00
Dhaifallah Alwadani
7f3f65d9f4 Add arabic tests 2017-06-22 23:49:07 +03:00
José Moreno
bccd3c0508 [MERGE]Conflicts resolved. 2017-04-04 10:48:09 -05:00
dazre
4225663bd2 Merge branch 'master' into master 2017-04-04 17:34:26 +03:00
dazre
e226cf7d73 add test 2017-04-04 17:32:55 +03:00
Ernesto Rodriguez Ortiz
76fd9d905f Fix the tests after the changes proposed by @10537
Ref: issuer # 10537
2017-04-03 17:29:03 -04:00
Diep Huu Hoang
c200d97bd7 [IMP] Improve convert number method and add unittest for Vietnam lang 2017-04-01 12:39:26 +07:00
Ernesto Rodriguez Ortiz
dac18f8928 Merge branch 'master' of git://github.com/10537/num2words into 10537-master 2017-03-31 17:49:24 -04:00
José Moreno
fb2911deea [FIX]Fixed typo errors and PEP8 errors.
[DEL]Deleted test_case currency.
2017-03-31 10:53:55 -05:00
José Moreno
afcaff8100 [IMP] Adds a better test cases. 2017-03-31 10:38:39 -05:00
José Moreno
19d0a903ab [IMP] Adds test files for es, es_co and es_ve. 2017-03-31 10:15:53 -05:00
Filippo Costa
90e7c9dc7d Improvements, corrections, and bug fixes for the lang_IT module. (#59)
* General refactoring and bug fixes for lang_IT

* Added Python3 support for lang_IT

* Bug fixes for ordinal numerals in lang_IT

* Fixed lang_IT for negative values and added tests

* Fixes and minor adjustments for floats in lang_IT

* Decimal => float in tests for lang_IT

* Moved a comment

* 'tre's accentuated, big numbers support, ordinal bug fix, comments, tests

* 'meno' and 'virgola' and now class values

* Destroyed EU inheritance
2017-03-17 09:12:44 -04:00
Krzysztof Socha
1667511ff3 Merge remote-tracking branch 'upstream/master' 2017-02-27 18:14:11 +01:00
Krzysztof Socha
d586f620c5 Added unit tests for Polish language 2017-02-27 17:18:06 +01:00
Brett Anthoine
c9ecd07cbf Add italian ordinals. 2016-12-29 16:16:45 +01:00
Brett Anthoine
08779b28b2 Add support for italian. 2016-12-29 16:16:45 +01:00
Virgil Dupras
20f634028d Convert to single codebase for py2 and py3
No more 2to3. Also, added tox config for easy cross-python testing.
2016-11-22 09:13:18 -05:00
Virgil Dupras
02bb4bcf13 Merge pull request #27 from isnani/master
correction on lang_DE: ordnum, plural and ord form of >= 10**6
2016-08-10 13:21:57 -04:00
Virgil Dupras
2d18b40150 Merge pull request #47 from akretion/pt_BR-change_point_to_comma
In Brazilian Portuguese the decimal sign is comma ','
2016-08-10 13:17:51 -04:00