Merge branch 'master' into master

This commit is contained in:
Armin Oliya
2017-09-12 00:57:01 +02:00
committed by GitHub

View File

@@ -4,11 +4,10 @@ num2words - Convert numbers to words in multiple languages
.. image:: https://travis-ci.org/savoirfairelinux/num2words.svg?branch=master .. image:: https://travis-ci.org/savoirfairelinux/num2words.svg?branch=master
:target: https://travis-ci.org/savoirfairelinux/num2words :target: https://travis-ci.org/savoirfairelinux/num2words
``num2words`` is a library that converts numbers like ``42`` to words like ``num2words`` is a library that converts numbers like ``42`` to words like ``forty-two``.
``forty-two``. It supports multiple languages (English, Arabic, Danish, French, It supports multiple languages (see the list below for full list
German, Dutch, Hebrew, Italian, Latvian, Norwegian, Polish, Portuguese, Russian, of languages) and can even generate ordinal numbers like ``forty-second``
Spanish and Lithuanian) and can even generate ordinal numbers like (although this last feature is a bit buggy for some languages at the moment).
``forty-second`` (altough this last feature is a bit buggy at the moment).
The project is hosted on https://github.com/savoirfairelinux/num2words The project is hosted on https://github.com/savoirfairelinux/num2words
@@ -47,17 +46,21 @@ cardinal one.
**lang:** The language in which to convert the number. Supported values are: **lang:** The language in which to convert the number. Supported values are:
* ``en`` (English, default)
* ``ar`` (Arabic) * ``ar`` (Arabic)
* ``de`` (German) * ``de`` (German)
* ``dk`` (Danish) * ``dk`` (Danish)
* ``en`` (English, default) * ``en_GB`` (English - Great Britain)
* ``en_GB`` (British English) * ``en_IN`` (English - India)
* ``en_IN`` (Indian English)
* ``es`` (Spanish) * ``es`` (Spanish)
* ``es_CO`` (Spanish - Colombia)
* ``es_VE`` (Spanish - Venezuela)
* ``eu`` (EURO)
* ``fr`` (French) * ``fr`` (French)
* ``fr_CH`` (Swiss French) * ``fr_CH`` (French - Switzerland)
* ``fr_DZ`` (Argelia French) * ``fr_DZ`` (French - Algeria)
* ``he`` (Hebrew) * ``he`` (Hebrew)
* ``id`` (Indonesian)
* ``it`` (Italian) * ``it`` (Italian)
* ``lt`` (Lithuanian) * ``lt`` (Lithuanian)
* ``lv`` (Latvian) * ``lv`` (Latvian)
@@ -65,9 +68,10 @@ cardinal one.
* ``pl`` (Polish) * ``pl`` (Polish)
* ``pt_BR`` (Brazilian Portuguese) * ``pt_BR`` (Brazilian Portuguese)
* ``ru`` (Russian) * ``ru`` (Russian)
* ``tr`` (Turkish)
* ``vn`` (Vietnamese)
* ``nl`` (Dutch) * ``nl`` (Dutch)
You can supply values like ``fr_FR``, the code will be correctly interpreted. If You can supply values like ``fr_FR``, the code will be correctly interpreted. If
you supply an unsupported language, ``NotImplementedError`` is raised. you supply an unsupported language, ``NotImplementedError`` is raised.
Therefore, if you want to call ``num2words`` with a fallback, you can do:: Therefore, if you want to call ``num2words`` with a fallback, you can do::