Commit Graph

339 Commits

Author SHA1 Message Date
romangraef
0377347cb9 fixed pep8 line too long errors in tests/test_de.py 2018-10-05 20:14:28 -04:00
romangraef
5650d2818d added more tests to lang_DE.py 2018-10-05 20:14:28 -04:00
CrazyMerlyn
f09ad9afdf Add tests for lang_EN ordinal coversion 2018-09-25 11:03:53 -04:00
Mārtiņš Šulcs
5f91c1420f Reduce indent level 2018-09-25 17:44:08 +03:00
Mārtiņš Šulcs
61dd1c9a4f Test currency not implemented, remove dead method. 2018-09-25 17:44:08 +03:00
Mārtiņš Šulcs
26fef2e116 More tests 2018-09-25 17:44:08 +03:00
Mārtiņš Šulcs
03d44f4bc3 Very naive to_currency implementation for NL 2018-09-25 17:44:08 +03:00
CrazyMerlyn
23902ab7c5 [FIX] lang_FR: Fixed decimal handling in french currency
Fixes #179
2018-09-25 10:29:56 -04:00
CrazyMerlyn
b541ee8d8e Add tests for lang_EN_IN 2018-09-21 16:12:06 +05:30
Lise Rebout
c71d99cddf Small corrections concerning the plural of millions, milliards, cents and vingts 2018-09-17 13:04:32 -04:00
Mārtiņš Šulcs
2a99ff1061 Cleanup (#194)
* Remove some dead code.

* Overloadable _cents_terse

* One setup should be enough

* Move gen_high_numwords up

* Cards are optional.

* Line length

* DRY set_hight_numwords for EU base.

* Remove unused error message. It has to be an exception anyway.
2018-09-17 09:30:36 -04:00
Jacob Cook
44354bf9ce Merge pull request #193 from savoirfairelinux/cmd
Add a command line tool to use num2words, credits to @hernamesbarbara
2018-09-16 17:10:33 -04:00
Ernesto Rodriguez Ortiz
62f3cad2d6 Add a command line tool to use num2words, credits to @hernamesbarbara 2018-09-16 16:43:44 -04:00
Abdullah Alhazmy
f72c9997c6 Improve Arabic implementation (#176)
* Change Arabic Lang implementation
* Improve Arabic class, * update Arabic test cases
* Support EGP and KWD currency
* Add test cases
* Remove .cache and .pytest_cache folder
* Increase coverage from 84 to 90 #122
* Increase coverage from 90 to 92 #122
* Fix ordinal issue #166
2018-09-11 13:45:26 -04:00
SButko
7639f5a820 [ADD] lang_LT: new currencies, feminine numerals
- Adding feminine numeric forms.
- Implementing new currency forms: USD, GBP, PLN, RUB (with feminine
	numeric forms).
2018-08-30 11:38:17 -04:00
Andrius Laukavičius
39f522f34a [FIX] lang_LT, lang_LV: negative amounts (#185)
Negative amounts were not working (when no currency is used), because
`get_digits` method does not expect `-` sign, which crashes conversion.
To avoid that, we split minus sign from number string and prepare its
word to be used with amount words.

closes: #184
2018-08-23 10:39:03 -04:00
Andrew Hlynskyi
1ca8225ea6 Fix orthography for EUR currency in UK lang (#183) 2018-08-16 10:17:37 -04:00
Ege Güneş
e394ca6e9e Fix typo 2018-07-20 11:51:10 -04:00
Istvan SZALAÏ
f275d0fde9 Release 0.5.7 (#175)
* New maintainer 🚀

Since @erozqba no longer work for Savoir-faire Linux, the maintainer has changed.

* Bump version from 0.5.6 -> 0.5.7

* Update CHANGE.rst to publish a new release.
2018-06-27 17:55:14 -04:00
Istvan SZALAÏ
8975222487 [FIX] move language specific info to the wiki (#174)
* [FIX] move language specific info to the wiki

The informations about Finnish and Japanese can be found in the [wiki](https://github.com/savoirfairelinux/num2words.wiki.git)
The goal of this commit is to keep the readme short.

* [FIX] add wiki mention in the readme.rst
2018-06-27 17:51:28 -04:00
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
James ADJINWA
569b29af39 Typo correction in documentation (#155) 2018-01-31 09:24:28 -05:00
François Honoré (Acsone)
ce21cb9f18 [ADD] Add lang fr_BE + tests (#151) 2018-01-16 14:38:43 -05:00
Antonio Gurgel
e28394d29f Improve README.rst. (#145)
* Improve README.rst.

* Fix "Usage": "cardinal" => "ordinal".

>>> num2words(42,to='cardinal')
u'forty-two'
>>> num2words(42,to='ordinal')
u'forty-second'

* Add PyPI shield. Closes #36.

* Fix link to GitHub.

* Maintain "country - language" consistency

* Fix typos, clarify country-language fallback
2017-12-19 07:51:58 -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
8ffdc5e49d Update CHANGE.rst to publish a new release.
Ref: issue #140
2017-11-22 14:35:46 -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
Ernesto Rodriguez Ortiz
ee9f767b06 Create PULL_REQUEST_TEMPLATE.md 2017-11-05 15:19:46 -05:00
Ernesto Rodriguez Ortiz
c511f499b9 Create ISSUE_TEMPLATE.md 2017-11-05 15:16:23 -05:00
Ernesto Rodriguez Ortiz
a98c75e394 Create CONTRIBUTING.md 2017-11-05 15:15:15 -05:00
Ernesto Rodriguez Ortiz
dde43cb4e5 Create CODE_OF_CONDUCT.md 2017-11-05 15:07:12 -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
Ernesto Rodriguez Ortiz
c326d59b2d Replace a custom implementation of an ordered dict in the file orderedmapping.py by collections.OrderedDict (#131) 2017-11-01 09:55:24 -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
abae0b56a2 Update fichier README.rst to fix the coverage badge 2017-10-30 14:08:44 -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
Ernesto Rodriguez Ortiz
c6015db8b4 Update tox.ini to check more stuffs (#103) 2017-10-26 20:10:44 -04:00
Ernesto Rodriguez Ortiz
34d5a4cd5a Merge pull request #102 from savoirfairelinux/remove_lang_EN_GB_old_file
Remove old and not used file num2words/lang_EN_GB_old.py
2017-10-26 16:11:06 -04:00
Ernesto Rodriguez Ortiz
14bcd99cab Remove old and not used file num2words/lang_EN_GB_old.py 2017-10-26 16:08:33 -04:00
Ernesto Rodriguez Ortiz
3788cb213a Merge pull request #101 from shulcsm/expose_to_currency
Expose to to_currency.
2017-10-26 15:06:34 -04:00
Ernesto Rodriguez Ortiz
02a52aab5b Merge pull request #100 from shulcsm/pass_kwargs_to_converters
Pass kwargs to converters.
2017-10-26 15:05:12 -04:00
Ernesto Rodriguez Ortiz
168707744d Merge pull request #98 from williamjmorenor/master
Fix some pep8 issues
2017-10-26 15:03:27 -04:00