package
Version:
v0.18.1
Opens a new window with list of versions in this module.
Published: Sep 21, 2015
License: BSD-2-Clause, Apache-2.0
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Inflector
Inflector pluralizes and singularizes English nouns.
Documentation: http://godoc.org/github.com/gedex/inflector
Basic Usage
There are only two exported functions: Pluralize
and Singularize
.
s := "People"
fmt.Println(inflector.Singularize(s)) // will print "Person"
s2 := "octopus"
fmt.Println(inflector.Pluralize(s2)) // will print "octopuses"
Please see example/example.go for a complete example.
Credits
License
This library is distributed under the BSD-style license found in the LICENSE.md file.
Documentation
¶
Package inflector pluralizes and singularizes English nouns.
There are only two exported functions: `Pluralize` and `Singularize`.
s := "People"
fmt.Println(inflector.Singularize(s)) // will print "Person"
s2 := "octopus"
fmt.Println(inflector.Pluralize(s2)) // will print "octopuses"
Pluralize returns string s in plural form.
Singularize returns string s in singular form.
type InflectorRule struct {
Rules []*ruleItem
Irregular []*irregularItem
Uninflected []string
}
InflectorRule represents inflector rule
Rule represents name of the inflector rule, can be
Plural or Singular
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.