Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix s plural noun #168

Merged
merged 6 commits into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions inflect/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2981,6 +2981,9 @@ def _plnoun( # noqa: C901

# OTHERWISE JUST ADD ...s

if word[-1] == "s":
return word

return f"{word}s"

@classmethod
Expand Down Expand Up @@ -3428,6 +3431,9 @@ def _sinoun( # noqa: C901
if words.lowered[-3:] == "xes":
return word[:-2]

if words.lowered[-2:] == "ss":
return False

# HANDLE ...f -> ...ves

if word in si_sb_ves_ve_case or words.last.lower() in si_sb_ves_ve:
Expand Down Expand Up @@ -3477,6 +3483,15 @@ def _sinoun( # noqa: C901

if word in si_sb_es_is:
return word[:-2] + "is"
elif word[:-2] + "es" in si_sb_es_is:
return False

# HANDLE COMPOUNDS WITH ...es WORDS, LIKE CO-ANALYSES

if dash_split[-1] in si_sb_es_is:
return word[:-2] + "is"
elif dash_split[-1][:-2] + "es" in si_sb_es_is:
return False

# OTHERWISE JUST REMOVE ...s

Expand Down
14 changes: 14 additions & 0 deletions tests/inflections.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
classes -> class # VERB FORM
clippers -> clippers
clitoris -> clitorises|clitorides
co-analysis -> co-analyses
cod -> cod
codex -> codices
coitus -> coitus
Expand Down Expand Up @@ -319,6 +320,7 @@
goy -> goys|goyim
graffiti -> graffiti
TODO:singular_noun 2 diff ret values graffito -> graffiti
grass -> grasses
grizzly -> grizzlies
guano -> guanos
guardsman -> guardsmen
Expand Down Expand Up @@ -406,6 +408,7 @@
jackanapes -> jackanapes
Japanese -> Japanese
Javanese -> Javanese
jeans -> jeans
Jerry -> Jerrys
jerry -> jerries
jinx -> jinxes
Expand Down Expand Up @@ -446,6 +449,7 @@
Londonese -> Londonese
lore -> lores|lore
Lorrainese -> Lorrainese
loss -> losses
lothario -> lotharios
louse -> lice
Lucchese -> Lucchese
Expand Down Expand Up @@ -476,6 +480,7 @@
mantis -> mantises
marquis -> marquises
Mary -> Marys
mass -> masses
maximum -> maximums|maxima
measles -> measles
medico -> medicos
Expand All @@ -485,7 +490,9 @@
memorandum -> memorandums|memoranda
meniscus -> menisci
merman -> mermen
mess -> messes
Messinese -> Messinese
metabolysis -> metabolyses
metamorphosis -> metamorphoses
metropolis -> metropolises
mews -> mews
Expand All @@ -505,6 +512,7 @@
money -> monies
mongoose -> mongooses
moose -> moose
moss -> mosses
mother-in-law -> mothers-in-law
mouse -> mice
mumps -> mumps
Expand Down Expand Up @@ -563,6 +571,7 @@
Panaman -> Panamans
parabola -> parabolas|parabolae
Parmese -> Parmese
pass -> passes
pathos -> pathoses
pegasus -> pegasuses
Pekingese -> Pekingese
Expand All @@ -585,6 +594,7 @@
pika -> pikas
TODO:singular_noun ret mul value pincer -> pincers
pincers -> pincers
piss -> pisses
Pistoiese -> Pistoiese
plateau -> plateaus|plateaux
play -> plays
Expand Down Expand Up @@ -612,6 +622,7 @@
protozoan -> protozoans
protozoon -> protozoa
puma -> pumas
puss -> pusses
TODO:siverb put -> put
quantum -> quantums|quanta
TODO:singular_noun quartermaster general -> quartermasters general
Expand Down Expand Up @@ -641,6 +652,7 @@
rostrum -> rostrums|rostra
ruckus -> ruckuses
salmon -> salmon
sandal -> sandals
Sangirese -> Sangirese
TODO: siverb sank -> sank
Sarawakese -> Sarawakese
Expand Down Expand Up @@ -708,6 +720,7 @@
stereo -> stereos
stigma -> stigmas|stigmata
stimulus -> stimuli
stocking -> stockings
stoma -> stomas|stomata
stomach -> stomachs
storey -> storeys
Expand Down Expand Up @@ -780,6 +793,7 @@
tooth -> teeth
Torinese -> Torinese
torus -> toruses|tori
toss -> tosses
trapezium -> trapeziums|trapezia
trauma -> traumas|traumata
travois -> travois
Expand Down