jaraco / jaraco/inflect

Add flexibility to plurals of uppercase words

Open
#266 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.1k
Forks
127
PR merge metrics
No merged PRs in 30d

Description

There are common terms that are always uppercase (URL, ID, etc.), where adding a lower case 's' would be appropriate. However, `p.plural("URL", 2)` gives "URLS". The code currently makes an exception for "I", but it would be great to add a way to include our own exceptions. Thanks!
https://github.com/jaraco/inflect/blob/262a247d2d99a47a520cdb2d46adb90df88b4326/inflect/__init__.py#L2369-L2373

Contributor guide

No contributing guide indexed for this repository

Research direction

The relevant pluralization logic is in inflect/__init__.py around lines 2369-2373; start by reading the existing exception for "I" and the surrounding implementation. Add a caller-configurable way to handle uppercase-word exceptions, then verify that p.plural("URL", 2) can produce "URLs" while preserving the existing default behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.