Documentation ¶
Overview ¶
Package cases provides general and language-specific case mappers.
Index ¶
Constants ¶
const UnicodeVersion = "9.0.0"
UnicodeVersion is the Unicode version from which the tables in this package are derived.
Variables ¶
var (
Supported language.Coverage
)
Functions ¶
This section is empty.
Types ¶
type Caser ¶
type Caser struct {
// contains filtered or unexported fields
}
A Caser transforms given input to a certain case. It implements transform.Transformer.
A Caser may be stateful and should therefore not be shared between goroutines.
func Fold ¶
Fold returns a Caser that implements Unicode case folding. The returned Caser is stateless and safe to use concurrently by multiple goroutines.
Case folding does not normalize the input and may not preserve a normal form. Use the collate or search package for more convenient and linguistically sound comparisons. Use golang.org/x/text/secure/precis for string comparisons where security aspects are a concern.
func Title ¶
Title returns a Caser for language-specific title casing. It uses an approximation of the default Unicode Word Break algorithm.
func (Caser) Bytes ¶
Bytes returns a new byte slice with the result of converting b to the case form implemented by c.
func (Caser) Reset ¶
func (c Caser) Reset()
Reset resets the Caser to be reused for new input after a previous call to Transform.
type Option ¶
type Option func(o options) options
An Option is used to modify the behavior of a Caser.
func HandleFinalSigma ¶
HandleFinalSigma specifies whether the special handling of Greek final sigma should be enabled. Unicode prescribes handling the Greek final sigma for all locales, but standards like IDNA and PRECIS override this default.