[Repo Assist] Fix JsonProvider pluralizer incorrectly singularizing '-ases' words (e.g. 'purchases' → 'purchasis')#1600
Conversation
…. 'purchases' -> 'purchasis') Add 'ase'/'ases' suffix rule before the 'sis'/'ses' rule so that words like 'purchases', 'cases', 'phases', 'phrases' correctly singularize to 'purchase', 'case', 'phase', 'phrase' respectively. Add 'oasis'/'oases' to the special words list to preserve the correct singularization of 'oases' -> 'oasis', which would otherwise be affected by the new 'ase'/'ases' rule. Fixes #1508 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🤖 Note from Repo Assist After creating this PR I discovered that PR #1524 by I've nudged Apologies for the duplication — I should have checked for existing PRs more thoroughly before creating this one.
|
🤖 Repo Assist here — I'm an automated AI assistant for this repository.
Closes #1508Root Cause
The
Pluralizer.toSingularfunction applies suffix rules in order and stops at the first match. The rule for Latin-origin-sis/-sespairs (e.g.analysis→analyses) matched any word ending inses— including plain English words likepurchases,cases,phases,phrases.For example:
"purchases"ends with"ses"→ rule strips"ses", adds"sis"→"purchasis"❌Fix
Add a more specific
"ase"/"ases"suffix rule before the"sis"/"ses"rule in the ordered list. This means words likepurchasesare correctly handled first:"purchases"→ ends with"ases"→ strips"ases", adds"ase"→"purchase"✅"cases"→"case"✅"phases"→"phase"✅"phrases"→"phrase"✅To prevent regression for the genuine Greek/Latin word
oasis/oases(which would otherwise be caught by the new"ases"rule),"oasis"is added to the special-words list so it is resolved before any suffix rule is tried.Test Status
dotnet build FSharp.Data.sln -c Release)dotnet test tests/FSharp.Data.Core.Tests/FSharp.Data.Core.Tests.fsproj -c Release) — 2838 passed, 1 failed (pre-existing network connectivity failure unrelated to this change)Purchases singularizes correctly - regression test for issue 1508Warning
The following domain was blocked by the firewall during workflow execution:
www.google.com