Skip to main content

Dutch Noun Pluralizer in Python

Generates plural and singular nouns in a very imperfect way using Hunspell and OpenTaal dictionaries (v2.20.23, 2023-03-10) and word lists. Why imperfect? Because the Dutch language is full of exceptions.

The algorithm is based on the document "Basismorfologie. Het meervoud in het Nederlands" (Dutch) of the Université catholique de Louvain.

Note: I'm a .NET developer that does Python in my free time. I'm not a linguist, I just work for a Dutch company. Hence: this must be a very imperfect way of doing this. If you have good ideas, I welcome them — just open an issue on GitHub.

Installation

Python version: This package requires Python >=3.8. The devcontainer uses Python 3.14.

Install from PIP:

pip install dutch-pluralizer

System dependencies

The package requires libhunspell (the C library, not the CLI):

  • Debian/Ubuntu: apt-get install libhunspell-dev
  • macOS: brew install hunspell
  • Windows: Install a pre-built libhunspell binary or use WSL.

CLI usage

The project can be used as a CLI tool:

$ python -m dutch_pluralizer -p kaas
kazen

See docs/CLI.md for the full CLI reference with all options and output examples.

API

The API can be used like this:

from dutch_pluralizer import pluralize, singularize

# pluralize will return the result or None
assert pluralize("kaas") == "kazen"
assert pluralize("kazen") == None

# singularize will return the result or None
assert singularize("kazen") == "kaas"
assert singularize("kaas") == None

Advanced pluralization will give you more options:

from dutch_pluralizer import pluralize, pluralize_advanced, singularize

adv = pluralize_advanced("album")

# the plural
assert adv.plural == 'albums'

# what the algorithm (without Hunspell) created
# is probably not correct, that's why Hunspell is
# used on it. It is like a preprocessing:
assert adv.algorithmic_plural == 'alba'

# indicates that end result was found in Hunspell
assert adv.hunspell_spelled == True

# the plural was found by replacement of 
# 'a' to 'ums'
assert adv.switched_ending_from == 'a'
assert adv.switched_ending_to == 'ums'

# suggestions given by Hunspell when the algorithmic
# result was processed:
assert adv.suggestions == ( 'Alba',
                            'aba',        
                            'balba',
                            'albe',
                            'alia',
                            'alla',
                            'alma',
                            'alfa',
                            'Elba')

Add custom words to the dictionary:

from dutch_pluralizer import pluralize, singularize
from dutch_pluralizer.speller import ensure_hunspell_nl

def test_readme_example_3():

    # default dictionary does not understand these words,
    # as they are not Dutch
    assert pluralize("fibulatie") == None
    assert singularize("fibulaties") == None

    # add the words to the dictionary
    h = ensure_hunspell_nl()
    h.add("fibulatie")
    h.add("fibulaties")

    # check again
    assert pluralize("fibulatie", speller=h) == "fibulaties"
    assert singularize("fibulaties", speller=h) == "fibulatie"

Help!? The result is not correct

I told you it was imperfect! There is stuff this package can and cannot do:

  • We cannot discover words that are not recognized by Hunspell
  • We can only process nouns (Dutch: zelfstandige naamwoorden)
  • We can only return a single result, but we know that the singular of graven can be either graaf or graf. We currently have no support for these use cases.
  • We can add words, just open up a ticket on GitHub. Please make sure you provide some evidence on why the word should be added (like a VanDale.nl result).

Development

A devcontainer configuration is provided for a consistent development environment. Open the project in Visual Studio Code with the Dev Containers extension and it will automatically build and set up the container.

Alternatively, see DEV.md for manual setup instructions.

Metadata

Release files for dutch-pluralizer 0.0.43

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dutch-pluralizer 0.0.43
File Size Uploaded Provenance Actions
dutch_pluralizer-0.0.43.tar.gz 1.7 MB With provenance Details for dutch_pluralizer-0.0.43.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dutch-pluralizer 0.0.43
File Interpreter ABI Platform Actions
dutch_pluralizer-0.0.43-py3-none-any.whl Python 3 none any Details for dutch_pluralizer-0.0.43-py3-none-any.whl

Total release size: 3.4 MB

Release files / dutch_pluralizer-0.0.43.tar.gz

Download URL dutch_pluralizer-0.0.43.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
0e2be84a6e457031854984d1c3d0188defaf7f49838afcbccac8db2458fe8247
BLAKE2b-256 checksum
How to use checksums
cf80843bc06832d0df8341652519c9589976ee277d021366bbb9b8b5f5219d0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.

Transparency log

Release files / dutch_pluralizer-0.0.43-py3-none-any.whl

Download URL dutch_pluralizer-0.0.43-py3-none-any.whl
Size 1.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
d6ceaa73e41c30185cfb89821b2e0abe2034c5e71716904b9d0525f068f7d378
BLAKE2b-256 checksum
How to use checksums
cd58fe751e6bcd76be561826840430fa61176381232d551f5789ea3cbc9c2ad5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.

Transparency log

Security for dutch-pluralizer 0.0.43

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dutch_pluralizer-0.0.43.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page