jaraco / jaraco/inflect

Words ending in 's' should never be pluralized by adding another 's'

Open
#161 5 comments 3 reactions 0 assignees View on GitHub
feature help wanted
Dominant language
Python
Stars
1.1k
Forks
127
PR merge metrics
No merged PRs in 30d

Description

stockings -> stockingss
jeans -> jeanss
sandals -> sandalss

How do I avoid this? I can fix the specific words with defnoun('jeans', 'jeans'), which corrects the result for an isolated string 'jeans' -> 'jeans'.

However, if I try to run plural_noun on 'blue jeans' instead of 'jeans' it then breaks again, returning 'blue jeanss'. I understand this is because 'blue jeans' appears to be a different string from 'jeans', but perhaps it should check the rules for the part of the string it is altering?

I've gotten around this so far by this incredibly hacky 'solution', so any improvement would obviously be immensely appreciated:
```
plural = _INFLECT.plural_noun(key, count)
if plural.endswith('ss'):
plural = plural[0:-1]
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported cases with plural_noun, including “blue jeans,” and compare them with the defnoun('jeans', 'jeans') behavior. Trace how plural_noun applies rules to the final word or phrase; done means words ending in “s” are not given an extra “s” in both isolated and multi-word inputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.