sources

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: MIT Imports: 13 Imported by: 0

README

sources

Files in this directory with names ending .txt are vendored copies of external data and hereby explicitly excluded from copyright claims on my part.

Files in this directory with names matching generated_*.go are generated code based upon the external data. I make no copyright claims to the values embedded in this code, as those are a programmatic transformation from the public data.

Documentation

Index

Constants

View Source
const X11Locale string = "en_US.UTF-8"

Variables

This section is empty.

Functions

This section is empty.

Types

type Sources

type Sources struct {
	Unicode unicode.Unicode
	UBlocks unicode.Blocks
	Vim     VimData
	X11     X11Data
}

Sources encapsulates all the sources of data we use for various lookups.

func NewAll

func NewAll() *Sources

NewAll gives us a Sources item which has had loaded all the data sources that we know about.

func NewEmpty

func NewEmpty() *Sources

NewEmpty gives us a Sources item with no data loaded.

func NewFast added in v0.0.3

func NewFast() *Sources

NewFast gives us a Sources item which has the fast data; no search, no live vim

func (*Sources) LoadLiveVim added in v0.0.3

func (s *Sources) LoadLiveVim() *Sources

LoadLiveVim gives us dynamically-loaded data about vim digraphs, retrieved by invoking vim. Will handle vim not being installed (but will print errors; we'll probably change this in the future).

func (*Sources) LoadLiveVimAgain added in v0.0.3

func (s *Sources) LoadLiveVimAgain() *Sources

LoadLiveVimAgain avoids the cache so that data is loaded from Vim again

func (*Sources) LoadStaticVim added in v0.0.3

func (s *Sources) LoadStaticVim() *Sources

LoadStaticVim gives us vim digraphs built into character, based upon shipping digraphs as of some unspecified version of vim.

func (*Sources) LoadStaticX11 added in v0.6.1

func (s *Sources) LoadStaticX11() *Sources

LoadStaticX11 gives us the X11 compose sequences built into character.

func (*Sources) LoadUnicode

func (s *Sources) LoadUnicode() *Sources

LoadUnicode gives us static information about Unicode data sources.

func (*Sources) LoadUnicodeBlocks added in v0.6.1

func (s *Sources) LoadUnicodeBlocks() *Sources

LoadUnicodeBlocks makes available Unicode block information

func (*Sources) LoadUnicodeSearch added in v0.0.3

func (s *Sources) LoadUnicodeSearch() *Sources

LoadUnicodeSearch gives us static information about Unicode data sources, but also gives us substring search capabilities.

type VimData

type VimData struct {
	DigraphByRune map[rune][]VimDigraph
}

VimData is the set of all data we have retrieved about characters from vim.

func (VimData) DigraphsFor

func (v VimData) DigraphsFor(r rune) string

DigraphsFor retrieves a string which is a space-separated list of the known digraph sequences which will produce a given rune.

func (VimData) DigraphsSliceFor added in v0.6.1

func (v VimData) DigraphsSliceFor(r rune) []string

DigraphsSliceFor returns the same as DigraphsFor but without space-joining. Just in case someone uses a space as part of a digraph sequence, we don't split on space for the one case where we want this.

type VimDigraph

type VimDigraph struct {
	Sequence  string
	Result    rune
	Codepoint int
}

VimDigraph encapsulates a vim digraph sequence, which is an input tuple of keypresses which together result in a rune. After typing "Ctrl-K", you might enter "Pd" to get "£".

type X11Data added in v0.6.1

type X11Data struct {
	// The string is a space-separated list of input sequences.
	// An ASCII SPACE 0x20 will not appear, as we encode it as `␠` 0x2420.
	DigraphsByRune map[rune]string
}

X11Data is the set of all data we have about X11 keyboard sequences. Note: we only have static compile-time data, we don't (at this time?) support ~/.XCompose TODO: support ~/.XCompose using the same liveness flag as for vim? New flag?

func (X11Data) DigraphsFor added in v0.6.1

func (x X11Data) DigraphsFor(r rune) string

DigraphsFor retrieves a string which is a space-separated list of the known digraph sequences which will produce a given rune. Note that we use `␠` in place of space in our representation.

func (X11Data) DigraphsSliceFor added in v0.6.1

func (x X11Data) DigraphsSliceFor(r rune) []string

DigraphsSliceFor returns a list of input sequences which emit the given rune. We take firm advantage of our ␠ usage here.

Jump to

Keyboard shortcuts

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