You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
singularize() returns non-words for common plurals: shoes -> sho, toes -> to, pies -> py, cookies -> cooky, dives -> dife #128
singularize() strips the wrong suffix from several common regular plurals and returns non-words. These are different from the -se nouns in #123 and from #112.
For comparison, movies -> movie, hives -> hive and cave/caves work, so only some endings are affected.
Cause (as far as I can tell)
The generic -oes -> o rule (potatoes -> potato, heroes -> hero) catches shoes, toes, foes and canoes. The -ies -> y rule catches words where the ie is part of the stem (pies, ties, lies, cookies, zombies, selfies). The -ves -> fe/f rule makes dives -> dife. The final -s strip for cactus is a separate rule hit.
Suggested fix
Add exceptions to the singular rules, or add them to the irregular word list, for at least: shoe, toe, foe, canoe, pie, tie, lie, cookie, zombie, selfie, dive. Happy to send a PR with tests if you want one.
Activity