Skip to main content

A package that expands Icelandic numbers to their corresponding written form

Project description

Númi

Númi er pakki sem stafar út tölustafi. Þegar notandinn gefur Núma tölu ásamt streng sem inniheldur upplýsingar um beygingar skilar hann öllum mögulegum leiðum sem þessi tala getur verið stöfðu út.

This package expands Icelandic numbers to their corresponding written form. Given a digit and a string containing the case, gender and inflection the funciton will output a list of strings for all written variants.

Usage

To get started run

pip install numi

The main function in numi is spell_out. It takes in two parameters, an number and a string specifying the desired morphology.

In the following example we want to get the numer 124 in plural, masculine and nominative form.

from numi import spell_out
print(spell_out(124, "ft_kk_nf")

> ["eitt hundrað tuttugu og fjórir", "hundrað tuttugu og fjórir"]

All the abrivations for the input string are as follows:

Abbr. English Icelandic
et singular eintala
ft plural fleirtala
kk masculine karlkyns
kvk feminine kvenkyns
hvk neuter hvorugkyns
nf nominative nefnifall
þf accusative þolfall
þgf dative þágufall
ef genitive eignafall

Contributing

This package is a work in progress. We use pytest for development test and run pip install requirements_dev.txt for development packages.

License

MIT

Project status

  • 0.0.5 - Support for numbers between 1-999

Future work

  • Adding the first decimal place for all numbers
  • Parse user input in a robust way
  • Add CLI support
  • Add test script for development
  • Document the abbreviations

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

numi-0.0.6.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

numi-0.0.6-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file numi-0.0.6.tar.gz.

File metadata

  • Download URL: numi-0.0.6.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.12

File hashes

Hashes for numi-0.0.6.tar.gz
Algorithm Hash digest
SHA256 55c990f37e4ff9ad64b68f2c70903ec852a7897de8b01f1c850999f771bb1f3b
MD5 827be360ae03f1d5c5981803d5c030d4
BLAKE2b-256 ae1a96d5aac26ca620530e2a890204b819c131b795a5bf616938aa3a08838e08

See more details on using hashes here.

File details

Details for the file numi-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: numi-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.12

File hashes

Hashes for numi-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5f9378153fddb3306392dd7dc0d5cb2d02979bcf39f58470cba90e96ba3ac6b0
MD5 bee19ee6377c677f0d2eef31e092c793
BLAKE2b-256 1fde0701a6e98465016e730d4141924d42a3c4e7c3b0c52c7296af8b93cb0975

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page