alphabet

package
Version: v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package alphabet implements word-spelling alphabets. Clients should not use this internal package, used by github.com/simonnagl/spell/cmd/spell.

Index

Constants

This section is empty.

Variables

View Source
var (
	English = SpellingAlphabet{
			// contains filtered or unexported fields
	}
	BritishEnglish = SpellingAlphabet{
					// contains filtered or unexported fields
	}
	French = SpellingAlphabet{
			// contains filtered or unexported fields
	}
	Dutch = SpellingAlphabet{
			// contains filtered or unexported fields
	}
	German = SpellingAlphabet{
			// contains filtered or unexported fields
	}
	AustrianGerman = SpellingAlphabet{
					// contains filtered or unexported fields
	}
	SwissHighGerman = SpellingAlphabet{
					// contains filtered or unexported fields
	}
	Italian = SpellingAlphabet{
			// contains filtered or unexported fields
	}
	Spanish = SpellingAlphabet{
			// contains filtered or unexported fields
	}
	Turkish = SpellingAlphabet{
			// contains filtered or unexported fields
	}
	Norwegian = SpellingAlphabet{
				// contains filtered or unexported fields
	}
	Swedish = SpellingAlphabet{
			// contains filtered or unexported fields
	}
	Finnish = SpellingAlphabet{
			// contains filtered or unexported fields
	}
	Danish = SpellingAlphabet{
			// contains filtered or unexported fields
	}
	Czech = SpellingAlphabet{
			// contains filtered or unexported fields
	}
	EuropeanPortuguese = SpellingAlphabet{
						// contains filtered or unexported fields
	}
	BrazilianPortuguese = SpellingAlphabet{
						// contains filtered or unexported fields
	}
	Romanian = SpellingAlphabet{
				// contains filtered or unexported fields
	}
	Slovenian = SpellingAlphabet{
				// contains filtered or unexported fields
	}
	Russian = SpellingAlphabet{
			// contains filtered or unexported fields
	}
	Ukrainian = SpellingAlphabet{
				// contains filtered or unexported fields
	}
)

All SpellingAlphabet.

Functions

func Lookup added in v0.3.0

func Lookup(lang string) (SpellingAlphabet, Exactness)

Lookup returns the best matching SpellingAlphabet of All together with a confidence score.

Lookup interprets lang as a BCP 47 language tag and finds the best match for the SpellingAlphabets lang. golang.org/x/text/language is used for finding the best match. If there is no match, 'en' is used as the default SpellingAlphabet.

Types

type Exactness added in v0.3.1

type Exactness int

Exactness indicates the level of certainty for a given return value. The confidence level indicates whether a value was explicitly specified, whether it is a educated guess, or whether it is the default value.

const (
	Default Exactness = iota // full confidence that there was no match
	Guess                    // most likely value picked out of a set of alternatives
	Exact                    // exact match or explicitly specified value
)

func FromLangConfidence added in v0.3.1

func FromLangConfidence(c language.Confidence) Exactness

func (Exactness) String added in v0.3.1

func (c Exactness) String() string

type SpellingAlphabet

type SpellingAlphabet struct {
	// contains filtered or unexported fields
}

SpellingAlphabet represents a word-spelling alphabet.

SpellingAlphabet is a set of words used to pronounce the letters of an alphabet in oral communication.

func (SpellingAlphabet) LangEnglishName added in v0.3.1

func (sa SpellingAlphabet) LangEnglishName() string

LangEnglishName returns the full description in English, which language uses SpellingAlphabet.

func (SpellingAlphabet) LangSelfName added in v0.3.1

func (sa SpellingAlphabet) LangSelfName() string

LangEnglishName returns the full description which language uses SpellingAlphabet, in this language.

func (SpellingAlphabet) LangTag added in v0.3.1

func (sa SpellingAlphabet) LangTag() string

LangTag returns a BCP 47 tag, describing where SpellingAlphabet is used.

func (SpellingAlphabet) Names added in v0.3.0

func (sa SpellingAlphabet) Names() []string

Names of organisations or standards, defining or using this SpellingAlphabet.

func (SpellingAlphabet) Spell

func (sa SpellingAlphabet) Spell(text string) string

Spell generates the text to speak for spelling text.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL