finds.dev

jinzhu/inflection

Pluralizes and singularizes English nouns

View on GitHub

★ 525GoMITupdated Oct 2023

// the take

A Go port of Rails ActiveSupport's inflection logic — pluralize and singularize English nouns with case preservation. It's a dependency of GORM, which is where most of its real-world usage comes from. If you're not building an ORM or code generator, you probably don't need it.

Case preservation works correctly (PERSON → PEOPLE, FancyPerson → FancyPeople). Rule registration API mirrors ActiveSupport closely enough that porting Rails conventions is straightforward. Zero dependencies, single file implementation. CI is green and the rule set has been stable for years.

The global mutable rule registry is a foot-gun in concurrent or multi-tenant scenarios — there's no per-instance rule set. Last meaningful commit was 2023; English edge cases and new irregular words accumulate with no active maintainer attention. No support for other languages, and the README doesn't acknowledge this limit. The test suite covers happy paths but irregular edge cases in domain-specific vocabulary will silently return wrong results.

We read the README, the directory tree and a key source file in July 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
525
Forks
73
Language
Go
License
MIT
Last commit
16 Oct 2023

// nearby

If inflection isn't quite it.

All repos →