data

package
v0.0.0-...-bf6e1ee Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package data holds the dictionaries and word list built into the binary.

Embedding means dict works on a machine with nothing installed, which is most of the point: the word list alone tells you a spelling exists, and the dictionaries tell you what it means. Installed copies still win when they are present, so a newer GCIDE on the system is used in preference to this one.

Index

Constants

View Source
const (
	WiktName  = "wikt"
	WiktTitle = "English Wiktionary (CC BY-SA 4.0)"
	WiktPath  = "wikt.tsv.gz"
)

The Wiktionary definitions, for the ordinary vocabulary none of the dictionaries carry. Consulted last, after the name glosses.

View Source
const (
	WikiName  = "wiki"
	WikiTitle = "English Wikipedia (CC BY-SA 4.0)"
	WikiPath  = "wiki.tsv.gz"
)

Wikipedia summaries, for the brands, companies and people no dictionary carries. Consulted last of all.

View Source
const GlossName = "names"

GlossName is the id of the generated names-and-places source. It is consulted after every real dictionary, so a genuine definition always wins over "a surname".

View Source
const GlossPath = "names.tsv.gz"

GlossPath is the embedded gloss file, built by data/gen.

View Source
const GlossTitle = "Names and Places (US Census 2010, GeoNames)"

GlossTitle is what the status line shows for it.

Variables

View Source
var DictdDirs = []string{"/usr/share/dictd", "/usr/lib/dict", "/usr/local/share/dictd"}

DictdDirs are searched for installed dictionaries, which take precedence over the embedded copies so a newer or fuller database wins.

View Source
var Order = []string{"gcide", "wn", "foldoc", "jargon", "elements"}

Order is the order dictionaries are consulted. GCIDE leads because its 1913 prose is the reason to reach for a dictionary at all; WordNet covers the modern vocabulary GCIDE predates; the rest fill in acronyms and computing terms that neither general dictionary carries.

Functions

func Licenses

func Licenses() (map[string]string, error)

Licenses returns the copyright notice for each embedded dictionary, so the terms travel with the binary that contains the data.

func OpenSet

func OpenSet(dirs []string) *dictdb.Set

OpenSet builds the lookup chain: each dictionary in Order, preferring an installed copy in one of dirs over the embedded one, then the generated names-and-places glosses last so a real definition always wins.

Both the command and the tests use this, so what is measured is what runs. Pass nil for dirs to use only the embedded data.

func OpenSetWithout

func OpenSetWithout(exclude string) *dictdb.Set

OpenSetWithout is OpenSet with one source left out. The generator uses it to ask what the dictionaries cannot answer without consulting the gloss file it is in the middle of rebuilding.

func Paths

func Paths(name string) (index, body string)

Paths returns the embedded index and body paths for a dictionary.

func Words

func Words() ([]string, error)

Words returns the embedded word list.

Types

This section is empty.

Directories

Path Synopsis
Command gen builds data/names.tsv.gz: one-line glosses for the words in the built-in list that no dictionary defines.
Command gen builds data/names.tsv.gz: one-line glosses for the words in the built-in list that no dictionary defines.

Jump to

Keyboard shortcuts

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