fix: singularize 'analyses' to 'analysis' instead of 'analyasis'#125
Merged
Merged
Conversation
p-kuen
approved these changes
Jun 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
singularize('analyses')returnsanalyasis, which isn't a word. It should returnanalysis.pluralize('analysis')already givesanalyses, so singularize is just failing to invert it.The cause is the replacement string on the
-ses->-sisrule:The regex is
((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$.$1is the full stem (analy,ba,diagno, ...), and the inner letter groups are$2for(a),$3for(b),$4for(d), and so on. The template uses$2, but$2is only ever set on the(a)nalybranch, so it re-appends a straya:analy+a+sis=analyasis. For every other word$2is empty, which is whybases,diagnoses,parentheses,prognoses,synopses,thesesalready singularize correctly.$1already contains thata, so dropping$2fixesanalysesand leaves the other six untouched:Added assertions for
analyses,basesanddiagnosesin the singularize test to lock the family. Full suite passes.