Skip to content

Do not pluralize common uncountable mass nouns (#239) - #255

Open
uttam12331 wants to merge 1 commit into
jaraco:mainfrom
uttam12331:fix/uncountable-mass-nouns-239
Open

Do not pluralize common uncountable mass nouns (#239)#255
uttam12331 wants to merge 1 commit into
jaraco:mainfrom
uttam12331:fix/uncountable-mass-nouns-239

Conversation

@uttam12331

Copy link
Copy Markdown

Closes #239.

Problem

plural_noun() pluralizes uncountable mass nouns that have no ordinary plural form:

>>> import inflect
>>> p = inflect.engine()
>>> p.plural_noun("equipment")
'equipments'   # should be 'equipment'

Change

inflect already keeps a small set of uncountable nouns unchanged via the "UNCOUNTABLE NOUNS" entries in pl_sb_uninflected_endings (e.g. furniture, information). Several common mass nouns were simply missing. This adds a conservative set:

equipment, luggage, baggage, jewelry, machinery, cutlery, livestock

I deliberately kept the list to words that are unambiguously uncountable (no countable sense) and are not a suffix of a common countable word, so the existing suffix matching doesn't accidentally swallow ordinary plurals. As @ecederstrand noted in the issue, words like "paper" and "sugar" have both count and mass senses, so those are intentionally left out.

Tests

Added tests/test_uncountable_nouns.py:

  • test_mass_nouns_are_uninflected — each added mass noun is returned unchanged (fails on main, e.g. equipmentequipments).
  • test_countable_nouns_still_pluralize — an over-match guard verifying representative countable nouns (document, element, package, stock, block, cutter, …) still pluralize normally.

Full suite passes (214 passed, 16 pre-existing xfailed). ruff format --check is clean on the changed files, and the change introduces no new ruff check findings.

`plural_noun("equipment")` returned `"equipments"`. English mass nouns such
as equipment, luggage, baggage, jewelry, machinery, cutlery and livestock
have no ordinary plural form.

`inflect` already keeps a small set of uncountable nouns
(`pl_sb_uninflected_endings`, e.g. "furniture", "information") unchanged;
these words were simply missing. Add a conservative set of unambiguous mass
nouns to that list. Only words with no countable sense and that are not a
suffix of a common countable word are included, so ordinary plurals are
unaffected.

Closes jaraco#239
@ecederstrand

Copy link
Copy Markdown

Very cool, @uttam12331!

@jaraco any chance this could go in? It would allow me to delete a patched version of inflect in my own code base :-)

@ecederstrand

ecederstrand commented Jul 31, 2026

Copy link
Copy Markdown

FWIW, in my own patched version of inflect, I'm using this list of noncount nouns. Right now, I believe I lifted this list from https://www.britannica.com/dictionary/eb/3000-words/topic/noncount-nouns

_noncount_nouns = (
    "advice",
    "agriculture",
    "air",
    "anger",
    "attention",
    "chaos",
    "clothing",
    "courage",
    "dirt",
    "equipment",
    "fun",
    "furniture",
    "garbage",
    "homework",
    "housework",
    "information",
    "jewelry",
    "luck",
    "luggage",
    "mail",
    "news",
    "patience",
    "permission",
    "pollution",
    "progress",
    "research",
    "scenery",
    "slang",
    "smoke",
    "soccer",
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Noncount (mass) nouns improperly pluralized

2 participants