Skip to main content

Wolof numeral and currency phrase parser (range 1 to 1,000,000,000)

Project description

wolof-numbers

Wolof numeral and currency phrase parser. Parse Wolof cardinal numbers from 1 to 1,000,000,000 and currency phrases in XOF/FCFA/CFA. MIT-licensed, PyPI-published as v0.1.0.

Install

pip install wolof-numbers

Quick Start

from wolof_numbers import parse_number, parse_currency_amount, parse_strict

# Cardinal number
result = parse_number("ñaar junni")
print(result.value)       # 2000
print(result.confidence)  # 1.0

# Strict parsing (returns int, raises on ambiguity)
value = parse_strict("ñaar junni")
print(value)  # 2000

# Currency phrase
amt = parse_currency_amount("ñaar junni franc CFA")
print(amt.amount)    # 2000
print(amt.currency)  # "XOF"

Supported Range

Range Status
1 – 9 (ones) Supported
10 – 99 (tens) Supported
100 – 999 (hundreds) Supported
1,000 – 99,999 (thousands) Supported
100,000 – 999,999 Supported
1,000,000 – 1,000,000,000 Supported

Supported Forms

  • Cardinals only in v0.1.0 — benn (1), ñaar (2), … juróom-ñaar (7), fukk (10), téeméer (100), junni (1000)
  • Wolof↔French code-switchingñaar mille francs is parsed as 2000 XOF
  • Diacritic-insensitive inputnaar, NAAR, ñaar all resolve to canonical ñaar
  • ~100 orthographic aliases covering regional variants (Lebu, Saloum-Saloum, Northern cluster) and common ASR transcript variants

Known Limitations (v0.2 targets)

Form Example v0.1.0 Behavior
Ordinals ñaaréél (second) Raises UnsupportedNumeralForm(kind="ordinal")
Fractions genn ci ñaar (one-half) Raises UnsupportedNumeralForm(kind="fraction")
Arabic loanwords alfu (1000) Raises UnsupportedNumeralForm(kind="loanword")

Stability

v0.x.y: public API is committed-to; internals are not. Breaking changes to the public API will bump to 0.(x+1).0 with a migration note in CHANGELOG.

The public API surface consists of: parse, parse_strict, parse_number, parse_currency_amount, normalize, ParseResult, AmountResult, Interpretation, AmbiguityError, UnsupportedNumeralForm.

Linguistic Source

The cardinal numeral system is based on Guérin 2021 (Constance Guérin's linguistic research on Wolof numerals) and supplemented by jangawolof.org.

Contributing

Non-developers can extend the alias table by editing wolof_numbers/data/aliases.yaml — no Python knowledge required. Each entry maps a canonical Wolof orthography to a list of accepted variants. Open a PR with new variants and a usage example.

License

MIT — see LICENSE. Copyright (c) 2026 Kuma Labs.

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

wolof_numbers-0.3.0.tar.gz (27.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wolof_numbers-0.3.0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file wolof_numbers-0.3.0.tar.gz.

File metadata

  • Download URL: wolof_numbers-0.3.0.tar.gz
  • Upload date:
  • Size: 27.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for wolof_numbers-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b653f76563961b32df8be346177b70f1f79d175442623e18b699d952a0ca6cfb
MD5 1b2420cb93caedeb4a26c20aba722f42
BLAKE2b-256 f8f9abb5a9b163221d0be35d7bf96e08e10435baa9770a53d47d9137871c2c29

See more details on using hashes here.

File details

Details for the file wolof_numbers-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: wolof_numbers-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for wolof_numbers-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2abc04b4d1ae5c22f088e8089891ee6564438c78bcd67ea9a1d0f61b7b0ff7ea
MD5 d30255fb93a33d8f917f331940d5a81a
BLAKE2b-256 5ff4f6e4de77deb6f38649288bf3c605eab2e6323d18c3a372d08ede010877b9

See more details on using hashes here.

Supported by

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