Documentation
¶
Overview ¶
Package english provides a comprehensive set of rules for English pluralization and singularization. It's the result of a deep dive into English morphology, designed to be highly accurate by respecting the complex hierarchy of its rules.
The core philosophy is that inflection isn't a single step, but a cascade: a word is first checked against a list of truly invariable words (uninflected), then against a list of unique irregular words, and only then is it processed by the general pattern-based rules.
A key principle in this library is the careful distinction between nouns that are sometimes uncountable (like "work") and those that are almost always invariable (like "information"). To allow for correct pluralization of words like "work" into "works" or "permission" into "permissions", the uninflected list is intentionally kept strict and concise.
Sources and references used for curation:
English Plurals (Wikipedia): For the foundational rules of regular, irregular, and loanword pluralization. https://en.wikipedia.org/wiki/English_plurals
Mass Nouns / Uncountable Nouns (Wikipedia): To understand the principles behind uncountable nouns and curate the uninflected list. https://en.wikipedia.org/wiki/Mass_noun
Plurale & Singulare Tantum (Wikipedia): For handling plural-only and singular-only nouns like "scissors" and "news". https://en.wikipedia.org/wiki/Plurale_tantum https://en.wikipedia.org/wiki/Singulare_tantum
Grammarist - Uncountable Nouns: Provided a practical list that helped refine the distinction between contextually and strictly uncountable nouns. https://grammarist.com/grammar/uncountable-nouns/
Wiktionary, the free dictionary: Used extensively for cross-referencing the plural forms and usage notes of individual, ambiguous words. https://en.wiktionary.org/
Doctrine Inflector (GitHub): For analysis of a robust, widely-used, and battle-tested inflection library. https://github.com/doctrine/inflector
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Language ¶
type Language struct {
// contains filtered or unexported fields
}
func (*Language) PluralRuleset ¶
func (r *Language) PluralRuleset() pluralizer.Ruleset
func (*Language) SingularRuleset ¶
func (r *Language) SingularRuleset() pluralizer.Ruleset