fix(inflekt): singularize coined -is/-us plurals (apis -> api) - #112
Merged
Conversation
Every word ending in -is/-us was assumed already singular, so an "apis"
table round-tripped to "apises". No suffix distinguishes the two cases
("apis" and "iris" are both a vowel plus s), so the real singulars now
come from the dictionary-generated exception table instead of a blanket
rule, and unknown words fall through to "drop the s".
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
devin-ai-integration Bot
pushed a commit
to constructive-io/constructive
that referenced
this pull request
Aug 5, 2026
0.7.2 read every -is/-us word as already singular, so an "apis" table became "apises" in getGraphQLQueryName and in the generated schema. constructive-io/dev-utils#112.
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.
Summary
singularizetreated every-is/-usword as already singular, so a coined plural of a vowel-final stem never lost itssand pluralizing it again doubled up —apis→apises, which is how it surfaced (agetGraphQLQueryName('apis')in constructive returnedapises).The premise was wrong, and no narrower regex fixes it:
apisandirishave the same shape (a vowel pluss), as domenusandradius. Which one a word is, is a dictionary fact, so the real singulars now come fromSINGULAR_EXCEPTIONSas self-mappings (status: 'status',iris: 'iris',radius: 'radius', 166 of them, all dictionary-proven byscripts/generate-exceptions.ts), and words no dictionary knows fall through to the generic "drop the s" — which is what identifiers want:apis→api,cpus→cpu,uris→uri.Those new self-mappings brought their plurals under the table's existing round-trip test and exposed a gap it had never covered (
aegis→aegises→aegise, since-sesis only-sisfor the Greek nouns), so the generator gained a closure pass for singulars that themselves end ins. Net table change: 747 → 743 entries, with the 212 removed entries (alibis: 'alibi',antis: 'anti', …) now handled by the generic rule instead of being listed.pluralizeis untouched and byte-identical to 0.7.2 on every word checked; onlysingularizechanges, and only for-is/-us.Testing
pnpm testinpackages/inflekt: 107 passed, including the new-is/-uscases (coined plurals, dictionary singulars left alone, dictionary vowel-stem plurals still depluralized).scripts/generate-exceptions.tsis idempotent: rerunning reproduces the committed table.pnpm buildandpnpm lintclean across the monorepo;pnpm -r testshows no failures caused by this (schema-ts-cli/yamlize-clifail on "no tests found", which is unrelated and pre-existing).Link to Devin session: https://app.devin.ai/sessions/c2c27132839a45219a440fd10cbf13a6
Requested by: @pyramation