Skip to content

Irregular plurals ending with 'i' or 'ae' are not recognized in Humanizer #1626

@clairernovotny

Description

@clairernovotny

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.Tests to 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.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions