Back to / internal

Package internal

Latest Go to latest
Published: Jun 16, 2020 | License: BSD-3-Clause | Module:


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


Package Files

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.

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)
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier