Documentation ¶
Overview ¶
Package transformer provides a few handy transformers, for use with Scanner and Segmenter.
We use the golang.org/x/text/transform package. We can accept anything that conforms to the transform.Transformer interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Diacritics transform.Transformer = transform.Chain(norm.NFD, runes.Remove(runes.In(unicode.Mn)), norm.NFC) // https://stackoverflow.com/q/24588295
Diacritics 'flattens' characters with diacritics, such as accents. For example, açaí → acai. (It has the side effect of normalizing to NFC form, which should be fine.)
View Source
var Lower transform.Transformer = cases.Lower(language.Und)
Lower transforms text to lowercase
View Source
var Upper transform.Transformer = cases.Upper(language.Und)
Upper transforms text to uppercase
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.