package english
import "github.com/dustin/go-humanize/english"
Package english provides utilities to generate more user-friendly English output.
Index ¶
- func OxfordWordSeries(words []string, conjunction string) string
- func Plural(quantity int, singular, plural string) string
- func PluralWord(quantity int, singular, plural string) string
- func WordSeries(words []string, conjunction string) string
Functions ¶
func OxfordWordSeries ¶
OxfordWordSeries converts a list of words into a word series in English, using an Oxford comma (https://en.wikipedia.org/wiki/Serial_comma). It returns a string containing all the given words separated by commas, the coordinating conjunction, and a serial comma, as appropriate.
func Plural ¶
Plural formats an integer and a string into a single pluralized string. The simple English rules of regular pluralization will be used if the plural form is an empty string (i.e. not explicitly given).
func PluralWord ¶
PluralWord builds the plural form of an English word. The simple English rules of regular pluralization will be used if the plural form is an empty string (i.e. not explicitly given). The special cases are not guaranteed to work for strings outside ASCII.
func WordSeries ¶
WordSeries converts a list of words into a word series in English. It returns a string containing all the given words separated by commas, the coordinating conjunction, and a serial comma, as appropriate.
Source Files ¶
- Version
- v1.0.1 (latest)
- Published
- Jan 10, 2023
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 5 days ago –
Tools for package owners.