jaraco/inflect

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

Offen

#161 geöffnet am 26.06.2022

 (5 Kommentare) (3 Reaktionen) (0 zugewiesene Personen)Python (125 Forks)github user discovery
featurehelp wanted

Repository-Metriken

Stars
 (1.082 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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