Versions in this module Expand all Collapse all v0 v0.2.0 Jun 12, 2019 v0.1.0 Jun 11, 2019 Changes in this version + const All + const BCP47 + const CLDR + const CLDRVersion + const Default + const Deprecated + const DeprecatedBase + const DeprecatedRegion + const DeprecatedScript + const Legacy + const Macro + const NumCompactTags + const Raw + const SuppressScript + var ErrMissingLikelyTagsData = errors.New("missing likely tags data") + func CompactIndex(t Tag) (index int, exact bool) + type Base struct + func MustParseBase(s string) Base + func ParseBase(s string) (Base, error) + func (b Base) ISO3() string + func (b Base) IsPrivateUse() bool + func (b Base) String() string + type CanonType int + func (c CanonType) Canonicalize(t Tag) (Tag, error) + func (c CanonType) Compose(part ...interface{}) (t Tag, err error) + func (c CanonType) Make(s string) Tag + func (c CanonType) MustParse(s string) Tag + func (c CanonType) Parse(s string) (t Tag, err error) + type Confidence int + const Exact + const High + const Low + const No + func Comprehends(speaker, alternative Tag) Confidence + func (c Confidence) String() string + type Coverage interface + BaseLanguages func() []Base + Regions func() []Region + Scripts func() []Script + Tags func() []Tag + var Supported Coverage = allSubtags{} + func NewCoverage(list ...interface{}) Coverage + type Extension struct + func ParseExtension(s string) (e Extension, err error) + func (e Extension) String() string + func (e Extension) Tokens() []string + func (e Extension) Type() byte + type MatchOption func(*matcher) + func PreferSameScript(preferSame bool) MatchOption + type Matcher interface + Match func(t ...Tag) (tag Tag, index int, c Confidence) + func NewMatcher(t []Tag, options ...MatchOption) Matcher + type Region struct + func EncodeM49(r int) (Region, error) + func MustParseRegion(s string) Region + func ParseRegion(s string) (Region, error) + func (r Region) Canonicalize() Region + func (r Region) Contains(c Region) bool + func (r Region) ISO3() string + func (r Region) IsCountry() bool + func (r Region) IsGroup() bool + func (r Region) IsPrivateUse() bool + func (r Region) M49() int + func (r Region) String() string + func (r Region) TLD() (Region, error) + type Script struct + func MustParseScript(s string) Script + func ParseScript(s string) (Script, error) + func (s Script) IsPrivateUse() bool + func (s Script) String() string + type Tag compact.Tag + var Afrikaans Tag = Tag(compact.Afrikaans) + var Albanian Tag = Tag(compact.Albanian) + var AmericanEnglish Tag = Tag(compact.AmericanEnglish) + var Amharic Tag = Tag(compact.Amharic) + var Arabic Tag = Tag(compact.Arabic) + var Armenian Tag = Tag(compact.Armenian) + var Azerbaijani Tag = Tag(compact.Azerbaijani) + var Bengali Tag = Tag(compact.Bengali) + var BrazilianPortuguese Tag = Tag(compact.BrazilianPortuguese) + var BritishEnglish Tag = Tag(compact.BritishEnglish) + var Bulgarian Tag = Tag(compact.Bulgarian) + var Burmese Tag = Tag(compact.Burmese) + var CanadianFrench Tag = Tag(compact.CanadianFrench) + var Catalan Tag = Tag(compact.Catalan) + var Chinese Tag = Tag(compact.Chinese) + var Croatian Tag = Tag(compact.Croatian) + var Czech Tag = Tag(compact.Czech) + var Danish Tag = Tag(compact.Danish) + var Dutch Tag = Tag(compact.Dutch) + var English Tag = Tag(compact.English) + var Estonian Tag = Tag(compact.Estonian) + var EuropeanPortuguese Tag = Tag(compact.EuropeanPortuguese) + var EuropeanSpanish Tag = Tag(compact.EuropeanSpanish) + var Filipino Tag = Tag(compact.Filipino) + var Finnish Tag = Tag(compact.Finnish) + var French Tag = Tag(compact.French) + var Georgian Tag = Tag(compact.Georgian) + var German Tag = Tag(compact.German) + var Greek Tag = Tag(compact.Greek) + var Gujarati Tag = Tag(compact.Gujarati) + var Hebrew Tag = Tag(compact.Hebrew) + var Hindi Tag = Tag(compact.Hindi) + var Hungarian Tag = Tag(compact.Hungarian) + var Icelandic Tag = Tag(compact.Icelandic) + var Indonesian Tag = Tag(compact.Indonesian) + var Italian Tag = Tag(compact.Italian) + var Japanese Tag = Tag(compact.Japanese) + var Kannada Tag = Tag(compact.Kannada) + var Kazakh Tag = Tag(compact.Kazakh) + var Khmer Tag = Tag(compact.Khmer) + var Kirghiz Tag = Tag(compact.Kirghiz) + var Korean Tag = Tag(compact.Korean) + var Lao Tag = Tag(compact.Lao) + var LatinAmericanSpanish Tag = Tag(compact.LatinAmericanSpanish) + var Latvian Tag = Tag(compact.Latvian) + var Lithuanian Tag = Tag(compact.Lithuanian) + var Macedonian Tag = Tag(compact.Macedonian) + var Malay Tag = Tag(compact.Malay) + var Malayalam Tag = Tag(compact.Malayalam) + var Marathi Tag = Tag(compact.Marathi) + var ModernStandardArabic Tag = Tag(compact.ModernStandardArabic) + var Mongolian Tag = Tag(compact.Mongolian) + var Nepali Tag = Tag(compact.Nepali) + var Norwegian Tag = Tag(compact.Norwegian) + var Persian Tag = Tag(compact.Persian) + var Polish Tag = Tag(compact.Polish) + var Portuguese Tag = Tag(compact.Portuguese) + var Punjabi Tag = Tag(compact.Punjabi) + var Romanian Tag = Tag(compact.Romanian) + var Russian Tag = Tag(compact.Russian) + var Serbian Tag = Tag(compact.Serbian) + var SerbianLatin Tag = Tag(compact.SerbianLatin) + var SimplifiedChinese Tag = Tag(compact.SimplifiedChinese) + var Sinhala Tag = Tag(compact.Sinhala) + var Slovak Tag = Tag(compact.Slovak) + var Slovenian Tag = Tag(compact.Slovenian) + var Spanish Tag = Tag(compact.Spanish) + var Swahili Tag = Tag(compact.Swahili) + var Swedish Tag = Tag(compact.Swedish) + var Tamil Tag = Tag(compact.Tamil) + var Telugu Tag = Tag(compact.Telugu) + var Thai Tag = Tag(compact.Thai) + var TraditionalChinese Tag = Tag(compact.TraditionalChinese) + var Turkish Tag = Tag(compact.Turkish) + var Ukrainian Tag = Tag(compact.Ukrainian) + var Und Tag = Tag{} + var Urdu Tag = Tag(compact.Urdu) + var Uzbek Tag = Tag(compact.Uzbek) + var Vietnamese Tag = Tag(compact.Vietnamese) + var Zulu Tag = Tag(compact.Zulu) + func Compose(part ...interface{}) (t Tag, err error) + func Make(s string) Tag + func MatchStrings(m Matcher, lang ...string) (tag Tag, index int) + func MustParse(s string) Tag + func Parse(s string) (t Tag, err error) + func ParseAcceptLanguage(s string) (tag []Tag, q []float32, err error) + func (t *Tag) UnmarshalText(text []byte) error + func (t Tag) Base() (Base, Confidence) + func (t Tag) Extension(x byte) (ext Extension, ok bool) + func (t Tag) Extensions() []Extension + func (t Tag) IsRoot() bool + func (t Tag) MarshalText() (text []byte, err error) + func (t Tag) Parent() Tag + func (t Tag) Raw() (b Base, s Script, r Region) + func (t Tag) Region() (Region, Confidence) + func (t Tag) Script() (Script, Confidence) + func (t Tag) SetTypeForKey(key, value string) (Tag, error) + func (t Tag) String() string + func (t Tag) TypeForKey(key string) string + func (t Tag) Variants() []Variant + type ValueError interface + Subtag func() string + type Variant struct + func ParseVariant(s string) (Variant, error) + func (v Variant) String() string