go-humanize: github.com/dustin/go-humanize/english Index | Files

package english

import "github.com/dustin/go-humanize/english"

Package english provides utilities to generate more user-friendly English output.

Index

Package Files

words.go

func OxfordWordSeries Uses

func OxfordWordSeries(words []string, conjunction string) string

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 Uses

func Plural(quantity int, singular, plural string) string

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 Uses

func PluralWord(quantity int, singular, plural string) string

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 Uses

func WordSeries(words []string, conjunction string) string

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.

Package english imports 3 packages (graph) and is imported by 9 packages. Updated 2018-07-13. Refresh now. Tools for package owners.