package internal
import "golang.org/x/text/internal"
Package internal contains non-exported functionality that are used by packages in the text repository.
Index ¶
- func SortTags(tags []language.Tag)
- func UniqueTags(tags []language.Tag) []language.Tag
- type InheritanceMatcher
Functions ¶
func SortTags ¶
SortTags sorts tags in place.
func UniqueTags ¶
UniqueTags sorts and filters duplicate tags in place and returns a slice with only unique tags.
Types ¶
type InheritanceMatcher ¶
type InheritanceMatcher struct {
// contains filtered or unexported fields
}
func NewInheritanceMatcher ¶
func NewInheritanceMatcher(t []language.Tag) *InheritanceMatcher
NewInheritanceMatcher returns a matcher that matches based on the inheritance chain.
The matcher uses canonicalization and the parent relationship to find a match. The resulting match will always be either Und or a language with the same language and script as the requested language. It will not match languages for which there is understood to be mutual or one-directional intelligibility.
A Match will indicate an Exact match if the language matches after canonicalization and High if the matched tag is a parent.
func (InheritanceMatcher) Match ¶
func (m InheritanceMatcher) Match(want ...language.Tag) (language.Tag, int, language.Confidence)
Source Files ¶
internal.go match.go
Directories ¶
Path | Synopsis |
---|---|
internal/catmsg | Package catmsg contains support types for package x/text/message/catalog. |
internal/cldrtree | Package cldrtree builds and generates a CLDR index file, including all inheritance. |
internal/colltab | Package colltab contains functionality related to collation tables. |
internal/export | |
internal/export/idna | Package idna implements IDNA2008 using the compatibility processing defined by UTS (Unicode Technical Standard) #46, which defines a standard to deal with the transition from IDNA2003. |
internal/export/unicode | Package unicode generates the Unicode tables in core. |
internal/format | Package format contains types for defining language-specific formatting of values. |
internal/gen | Package gen contains common code for the various code generation tools in the text repository. |
internal/gen/bitfield | Package bitfield converts annotated structs into integer values. |
internal/language | |
internal/language/compact | Package compact defines a compact representation of language tags. |
internal/number | Package number contains tools and data for formatting numbers. |
internal/stringset | Package stringset provides a way to represent a collection of strings compactly. |
internal/tag | Package tag contains functionality handling tags and related data. |
internal/testtext | Package testtext contains test data that is of common use to the text repository. |
internal/triegen | Package triegen implements a code generator for a trie for associating unsigned integer values with UTF-8 encoded runes. |
internal/ucd | Package ucd provides a parser for Unicode Character Database files, the format of which is defined in https://www.unicode.org/reports/tr44/. |
internal/utf8internal | Package utf8internal contains low-level utf8-related constants, tables, etc. |
- Version
- v0.22.0 (latest)
- Published
- Feb 4, 2025
- Platform
- linux/amd64
- Imports
- 2 packages
- Last checked
- 1 day ago –
Tools for package owners.