Documentation
¶
Overview ¶
Package text is the adapter for core/port/text: golang.org/x/net/idna for domains, and golang.org/x/text/unicode/norm for the Unicode normal form. Both libraries are confined here (ADR-0056).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Folded ¶
Folded is a name as the unique name indexes compare it (`lower(imm_unaccent(name))`): trimmed, lower case, its accents taken off. For an adapter that has to know before writing whether the database would take two names for one - the import meeting a collection's own columns and labels.
Types ¶
type Domains ¶
type Domains struct{}
Domains encodes domain names with the lookup profile: the one for a name that is going to be resolved, which maps case, checks the labels and refuses what the DNS would.
type Forms ¶
type Forms struct{}
Forms brings text to normal form C (i18n-l10n.md §5). NFC rather than NFKC: compatibility decomposition would rewrite what a person typed - `fi` into `fi`, `²` into `2`, full-width letters into ASCII - and a title is content, not an identifier. Canonical composition changes only the encoding of a character, never which character it is.
func (Forms) NFC ¶
NFC is the port's method. norm.NFC.String answers the input unchanged, without allocating, when it is already in normal form - which is nearly always.