$ go get -u github.com/martinusso/inflect
IntoWords convert numbers (float64) to words
func IntoWords(number float64) string
got := IntoWords(42) // -> forty-two
got := IntoWords(-147) // -> Minus one hundred and forty-seven
IsConsonant check if a character is a consonant
func IsConsonant(s string) bool
IsVowel check if a character is a vowel
func IsVowel(s string) bool
Ordinal returns the ordinal suffix that should be added to a number to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th...
func Ordinal(number int) string
got := Ordinal(-1) // -> st
got := Ordinal(42) // -> nd
Ordinalize turns a number into an ordinal string
func Ordinalize(number int) string
got := Ordinal(-1) // -> -1st
got := Ordinal(42) // -> 42nd
Parameterize replaces special characters in a pretty string
func Parameterize(s string) string
got := Parameterize("J. R. R. Tolkien") // -> "j-r-r-tolkien"
ParameterizeSep replaces special characters, according to the separator, in a string
func ParameterizeSep(s, sep string) string
got := ParameterizeSep("J. R. R. Tolkien", "_") // -> "j_r_r_tolkien"
Pluralize generates the plurals of nouns
func Pluralize(word string) string
got := Plural("word") // -> words
got := Plural("noun") // -> nouns
This software is open source, licensed under the The MIT License (MIT). See LICENSE for details.