internal

package
v0.0.0-...-e7e2df9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2024 License: MIT, BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package internal contains non-exported functionality that are used by packages in the text repository.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortTags

func SortTags(tags []language.Tag)

SortTags sorts tags in place.

func UniqueTags

func UniqueTags(tags []language.Tag) []language.Tag

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

Directories

Path Synopsis
Package catmsg contains support types for package x/text/message/catalog.
Package catmsg contains support types for package x/text/message/catalog.
Package colltab contains functionality related to collation tables.
Package colltab contains functionality related to collation tables.
Package format contains types for defining language-specific formatting of values.
Package format contains types for defining language-specific formatting of values.
compact
Package compact defines a compact representation of language tags.
Package compact defines a compact representation of language tags.
Package number contains tools and data for formatting numbers.
Package number contains tools and data for formatting numbers.
Package stringset provides a way to represent a collection of strings compactly.
Package stringset provides a way to represent a collection of strings compactly.
Package tag contains functionality handling tags and related data.
Package tag contains functionality handling tags and related data.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL