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 ¶
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.
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.
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".
const GlossPath = "names.tsv.gz"
GlossPath is the embedded gloss file, built by data/gen.
const GlossTitle = "Names and Places (US Census 2010, GeoNames)"
GlossTitle is what the status line shows for it.
Variables ¶
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.
var FS embed.FS
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 ¶
Licenses returns the copyright notice for each embedded dictionary, so the terms travel with the binary that contains the data.
func OpenSet ¶
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 ¶
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.
Types ¶
This section is empty.