package inflection

import "golazy.dev/lazysupport/inflection"

Package inflection contains word and naming helpers used by GoLazy conventions.

lazyroutes uses these helpers to infer REST resource names. Applications can use the package directly when they need the same singular, plural, or naming behavior without importing the router. Applications with domain-specific words can register Irregular rules during package initialization before routes or other conventional names are derived.

Variables

Functions

func Irregular

Irregular registers a singular/plural pair on the default inflector.

Call it from package initialization before code derives conventional names.

func Irregular(singular string, plural string)

Types

type Inflector

type Inflector struct {
	// contains filtered or unexported fields
}
func (i *Inflector) Camelize
func (i *Inflector) Camelize(term string) string
func (i *Inflector) Irregular

Irregular registers a singular/plural pair on this inflector.

func (i *Inflector) Irregular(singular string, plural string)
func (i *Inflector) Pluralize
func (i *Inflector) Pluralize(singular string) string
func (i *Inflector) Singularize
func (i *Inflector) Singularize(plural string) string
func (i *Inflector) Underscorize
func (i *Inflector) Underscorize(term string) string