Documentation ¶
Overview ¶
Package sentence provides functions for creating formatted sentences.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ProperNouns = map[string]struct{}{}
ProperNouns is a set-style map that contains all of the proper nouns that will not be lowercased (such as Google or Thompson). Proper nouns should be specified in their CamelCase form (Google, Thompson, etc). Proper nouns should be added to this map through AddProperNouns. By default, this map contains nothing.
Functions ¶
func AddProperNouns ¶
func AddProperNouns(nouns ...string)
AddProperNouns adds the given proper nouns (such as Google or Thompson) to ProperNouns. It is the way that end-user code should specify proper nouns. Proper nouns will not be lowercased when converting to sentence case. Proper nouns should be specified in their CamelCase form (Google, Thompson, etc).
func Case ¶
Case returns the sentence case version of the given string. It handles proper nouns through ProperNouns, abbreviations, and "I".
An example of a string in sentence case is:
This is a string in sentence case that I wrote in the USA with the help of Google
func Doc ¶ added in v0.1.8
Doc formats the given Go documentation string for an identifier with the given CamelCase name and intended label. It replaces the name with the label and cleans up trailing punctuation.
Types ¶
This section is empty.