Skip to content
Go library to pluralize and singularize English nouns ("cat" <=> "cats" etc.)
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
go.mod
go.sum
inflect.go
inflect_test.go

README.md

Package inflect can pluralize ("cat" => "cats", "man" => "men") or singularize ("cats" => "cat", "men" => "man") English language nouns.

API docs are here.

Usage:

import "github.com/kjk/inflect"

inflect.ToPlural("man") // "men"
inflect.ToPlural("men") // "men"

inflect.ToSingular("men") // "man"
inflect.ToSingular("man") // "man"

inflect.IsPlural("cats") // true
inflect.IsPlural("cat")  // false

inflect.IsSingular("cat")  // true
inflect.IsSingular("cats") // false

This is a Go port of https://github.com/blakeembrey/pluralize

You can’t perform that action at this time.