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
This commit is contained in:
siikamiika
2018-06-22 17:00:49 +03:00
committed by Ernesto Rodriguez Ortiz
parent 89554ff9e2
commit 8820681169
4 changed files with 3582 additions and 0 deletions

View File

@@ -71,6 +71,7 @@ Besides the numerical argument, there are two main optional arguments.
* ``es_CO`` (Spanish - Colombia)
* ``es_VE`` (Spanish - Venezuela)
* ``eu`` (EURO)
* ``fi`` (Finnish)
* ``fr`` (French)
* ``fr_CH`` (French - Switzerland)
* ``fr_BE`` (French - Belgium)
@@ -105,6 +106,38 @@ Therefore, if you want to call ``num2words`` with a fallback, you can do::
Additionally, some converters and languages support other optional arguments
that are needed to make the converter useful in practice.
**fi (Finnish)**
**case:** one of the following: nominative, genitive, partitive, inessive,
elative, illative, adessive, ablative, allative, essive, translative,
instructive, abessive, comitative. Defaults to nominative::
>>> num2words(42, lang='fi')
neljäkymmentäkaksi
>>> num2words(42, lang='fi', case='genitive')
neljänkymmenenkahden
>>> num2words(42, lang='fi', case='comitative')
neljinekymmeninekaksine
>>> num2words(42, lang='fi', to='ordinal', case='comitative')
neljänsinekymmenensinetoisine
**plural:** make the output words plural::
>>> num2words(42, lang='fi', plural=True)
neljätkymmenetkahdet
>>> num2words(42, lang='fi', case='essive', plural=True)
neljinäkymmeninäkaksina
>>> # same in plural
>>> num2words(42, lang='fi', case='comitative', plural=True)
neljinekymmeninekaksine
**prefer:** which case marker to use when there are multiple options::
>>> num2words(8, lang='fi', case="genitive", plural=True)
kahdeksien
>>> num2words(8, lang='fi', case="genitive", plural=True, prefer=["ain"])
kahdeksain
**ja (Japanese)**
**reading:** whether or not to return the reading of the converted number.