mirror of
https://github.com/bblaz/num2words.git
synced 2025-12-06 06:42:25 +00:00
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:
committed by
Ernesto Rodriguez Ortiz
parent
89554ff9e2
commit
8820681169
33
README.rst
33
README.rst
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user