keyboard

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyDist

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

KeyDist is the type that allows to find the best alternative based on keyboard layouts

func New

func New(l Layout) KeyDist

New produces a new instance of KeyDist, based on the keyboard layout you choose

func (KeyDist) CalculateDistance

func (kd KeyDist) CalculateDistance(input, ref string) float64

CalculateDistance calculates the total distances of the reference to the input

func (KeyDist) FindNearest

func (kd KeyDist) FindNearest(input string, list []string) (string, float64)

FindNearest finds the item in the list that is nearest to the input, based on the keyboard layout

type Layout

type Layout string

Layout is the type used to define keyboard layouts

const (
	Default  Layout = QwertyUS
	QwertyUS Layout = "qwerty-us"
)

Predefined keyboard layouts

Jump to

Keyboard shortcuts

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