languages

package
v0.0.0-...-3c04461 Latest Latest
Warning

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

Go to latest
Published: May 24, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KEYBOARDS = NewKeyboardRegistry()

KEYBOARDS stores all the registered keyboards

Functions

This section is empty.

Types

type Keyboard

type Keyboard struct {
	Code        string   `json:"code,omitempty"`
	Name        string   `json:"name,omitempty"`
	Description string   `json:"description,omitempty"`
	Language    Language `json:"language,omitempty"`
	Layout      []string `json:"layout,omitempty"`
}

Keyboard type

func (*Keyboard) Adjacent

func (urli *Keyboard) Adjacent(char string) (chars []string)

Adjacent returns adjacent characters on the given keyboard

type KeyboardGroup

type KeyboardGroup struct {
	Code        string   `json:"code,omitempty"`
	Keyboards   []string `json:"keyboards,omitempty"`
	Description string   `json:"description,omitempty"`
}

KeyboardGroup type

type KeyboardRegistry

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

KeyboardRegistry stores registered keyboards and groups

func NewKeyboardRegistry

func NewKeyboardRegistry() KeyboardRegistry

NewKeyboardRegistry returns a new KeyboardRegistry

func (*KeyboardRegistry) Add

func (kb *KeyboardRegistry) Add(keyboards []Keyboard)

Add allows you to add keyboards to the registry

func (*KeyboardRegistry) Append

func (kb *KeyboardRegistry) Append(name string, keyboards []Keyboard)

Append allows you to append keyboards to a group name

func (*KeyboardRegistry) Keyboards

func (kb *KeyboardRegistry) Keyboards(names ...string) (kbs []Keyboard)

Keyboards looks up and returns Keyboards.

type Language

type Language struct {
	Code         string              `json:"code,omitempty"`
	Name         string              `json:"name,omitempty"`
	Numerals     map[string][]string `json:"numerals,omitempty"`
	Graphemes    []string            `json:"graphemes,omitempty"`
	Vowels       []string            `json:"vowels,omitempty"`
	Misspellings [][]string          `json:"misspellings,omitempty"`
	Homophones   [][]string          `json:"homophones,omitempty"`
	Antonyms     map[string][]string `json:"antonyms,omitempty"`
	Homoglyphs   map[string][]string `json:"homoglyphs,omitempty"`
}

Language type

func (*Language) SimilarChars

func (lang *Language) SimilarChars(key string) (chars []string)

SimilarChars ...

func (*Language) SimilarSounds

func (lang *Language) SimilarSounds(str string) (words []string)

SimilarSounds ...

func (*Language) SimilarSpellings

func (lang *Language) SimilarSpellings(str string) (words []string)

SimilarSpellings ...

Jump to

Keyboard shortcuts

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