Commit Graph

316 Commits

Author SHA1 Message Date
Marek Madejski
9bd1bebb0e Shortened one test number for PEP8 compliance - smaller number parts are already tested. 2018-12-05 10:54:02 +01:00
Marek Madejski
4a0b323fa9 early continue
skip processing given power of thousand if it is 0
2018-12-03 16:07:15 +01:00
Marek Madejski
d78add4c3a Update test_pl.py
unit test fix
2018-12-03 12:40:04 +01:00
Marek Madejski
b8cd4ba181 no word for zero value of thousand's power; PL unit test fix
Before: 1_000_000_000 = "miliard milionów tysięcy" (with words for zero millions and thousands)
After: "miliard" (no words if value for given power of 1000 is 0)
2018-12-03 12:03:16 +01:00
Marek Madejski
518ce0b606 Update lang_PL.py
typo in "dziewięćset" (900) fix
2018-12-03 11:30:45 +01:00
Marek Madejski
efde954697 Update test_pl.py
added test for a really big number in Polish
2018-12-03 11:14:55 +01:00
Marek Madejski
a147dc3d34 Update lang_PL.py
PEP8 compliance
2018-12-03 09:59:53 +01:00
Marek Madejski
562e446716 Update lang_PL.py
- typo in "kwadryliard"
- expanded long scale up to decilliard (10^63)
2018-11-30 09:42:15 +01:00
Maxime St-Pierre
58613e0a18 Merge pull request #225 from savoirfairelinux/v0.5.8
Release 0.5.8
2018-11-17 20:03:20 -05:00
Ernesto Rodriguez Ortiz
fffb5c2dcf Release 0.5.8 2018-11-17 14:38:49 -05:00
Hugo Lefeuvre
66a47e2423 Improve german support (#222)
* german: fix case in currency names

Also, add more tests for german language.

* german: default to amount of euros, not cents

If a non-float number is provided, interpret it as a quantity in euros,
not cents.

* german: handle "ein Euro" vs "eins Euro" exception

* german: prefer "einhundert" over "hundert"

"hundert" is usually colloquial (even if widely used).

Exception: "eintausendste" and "hundertste" are special cases, here
"hundertste" and "tausendste" are usually preferred (see Duden).
2018-11-16 16:19:36 -05:00
Sangbum Kim
4d8c93847c Add: Korean support (#219)
* Add: lang_KO support

Added Korean language support and tests

* Remove commented code
2018-11-10 18:44:02 -05:00
fatkaratekid
1ed09f511d Add support for Serbian (Latin) (#207)
* Add support for Serbian language

* Fix the billion strings for short scale

Used the long scale name instead of the short one. Simplified the scale and the ones geneder definition.

* Adds Serbian to README
2018-11-10 18:36:51 -05:00
btharper
5c9bce19e4 Refactor testing setup (#220)
* Refactor tox and travis config files

Separates flake8 and isort into separate tox tasks
Tie flake8 and isort to specific python version so they only run once on Travis
Add python3.7 to tested python versions
* Requires newer Xenial base
* Running Xenial on Travis requires sudo
Move coveralls submission to travis config to avoid triggering during local runs.

* Require all tests to be run

Clean up test generation code form test_fi.py
Perform coverage measurement of tests
Fail tox if coverage of tests directory isn't at 100%

* Further Tox refactoring

Measure project coverage explicitly instead of omitting non-project files from reporting
Add branch measurement to coverage
Only report to coveralls if a .coverage result file exists
Make dependencies for each testenv explict and only include requried deps

* Small readme update to trigger travis

Add overly brief message about installing and running tox

* Fix unescaped flake8 violations

Unescaped \w -> \\w and \e to \\e in regex patterns found with updated flake8
2018-10-26 09:31:41 -04:00
Aaron M
c606fd54e8 Added missing numbers in "self.ords". (#218) 2018-10-20 16:56:19 -04:00
Olos
0f63859572 Add support for Portuguese (Portugal) (PT) (#198)
* add support for Portuguese (Portugal) (PT)

* FIX ADD SUPPORT TO PORTUGUESE (PORTUGAL) [PT]

removed venv/ from .gitignore.
correction from "milião" to "milhão" done on merge function.
removed hack for negword, creating a backup of the original one.

* add support PT (Portugal) (PT)

* add support PT (Portugal) (PT)

* add support PT (Portugal) (PT)

* add support PT (Portugal) (PT)

new tests
2018-10-20 15:53:14 -04:00
Sergej Herbert
6d30cb9e83 Increase German test coverage to 100% (#214)
* increase test coverage - german ordinal_num

* push coverage of german to 100%

* fix line width

* travis ci fix

* remove underscore between numbers due to backwords comp

* removed coverage file
2018-10-19 18:17:50 -04:00
mariaS210
ca61c77f3b Add Romanian support (#215)
* romanian-support: start implementation

* romanian-support: implement basic merge and to_ordinal

* romanian-support: fix linting error

* romaniansupport: fix spacing for linter

* romanian-support: correct indent of error message

* romanian-support: add encoding to test file

* romanian-support: python2 fix: make strings in test unicode

* romanian-support: complete rough implementation

* romanian-support: pylint fixes

* romanian-support: fix tests for python2

* romanian-support: small fixes

* romanian-support: add romanian to readme

* ensure alphabetical order in readme
2018-10-17 09:56:40 -04:00
Maxime St-Pierre
3544e49376 Merge pull request #216 from savoirfairelinux/issue165_iso_code_vi
Use language iso code for Vietnamese
2018-10-16 11:29:36 -04:00
Ernesto Rodriguez Ortiz
f9107c4938 Use language iso code for Vietnamese
Also update the readme and fix error, on the README.rst file we say tha
code language to use is vn, but to make it work you have to use vi_VN.
Let's refactor this to use the proper iso code `vi` in all places.
2018-10-15 12:32:42 -04:00
Sergej Herbert
dd25a8b4bf Correction of german ordinals. (#213) 2018-10-15 09:45:00 -04:00
MontakOleg
9a31d900e3 Add USD currency support to RU language (#211)
* Add USD currency support to RU language
2018-10-14 17:23:53 -04:00
Jose Carlos
dc733cfa1b lang_es: Add currency PEN (#200) 2018-10-13 19:29:58 -04:00
Temoctzin
424cf9fda8 feat(Num2Word_EU): add MX to CURRENCY_FORMS (#187)
* lang_EU: add MX to CURRENCY_FORMS and CURRENCY_ADJETIVES
2018-10-13 19:25:58 -04:00
btharper
26a2204f3b Add Delegator.py to test dependencies (#205)
Delegator.py is used for cli tests but isn't included in dependencies.
2018-10-13 19:20:54 -04:00
Vadim Smirnov
af49bb360f Implemented to_ordinal for RU (#212)
* Implemented to_ordinal for RU
2018-10-13 18:57:48 -04:00
romangraef
411a92a4fe fixed issues found in this PR 2018-10-05 20:14:28 -04:00
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