-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
Description
Problem
Humanizer currently does not recognize certain irregular plurals, specifically words ending in "i" or "ae" (e.g., "cacti", "algae"), in places where pluralization logic should apply. This limitation is evident when comparing with Roslyn, which handles such cases using:
if (symbol.Name.EndsWith("i", StringComparison.OrdinalIgnoreCase) || symbol.Name.EndsWith("ae", StringComparison.OrdinalIgnoreCase))
{
// Special handling for irregular plurals
}As a result, users may encounter incorrect singularization/pluralization for these forms, leading to unexpected results in string conversions or linguistic displays.
Proposed Fix
- Update Humanizer's pluralization logic to recognize and properly handle words ending in "i" and "ae" as irregular plurals.
- Ensure these cases are covered in both singularization and pluralization methods.
- Add/modify tests in
src/Humanizer.Teststo cover typical examples (e.g., "cactus" <-> "cacti", "alga" <-> "algae"). - Review existing resource files and registries to ensure these forms are localized correctly.
Impact
This change will improve Humanizer's linguistic accuracy and bring its behavior in line with best practices observed in other tools like Roslyn.
Copilot