english

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2023 License: MIT Imports: 3 Imported by: 85

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OxfordWordSeries

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

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

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

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL