tui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DbaseDir  string                // dictionary database directory.
	DictDbase map[string]DictEntity // dictionary database.
	DictWords []string              // sorted list of dictionary words

)

Functions

func FetchDbase

func FetchDbase() (err error)

FetchDbase downloads dictionary database files contained in the **remoteFiles** variable. The user's local database files changes tracker is updated to ensure that no download is made on database files without any changes.

func RenderLayout

func RenderLayout()

RenderLayout renders dictionary terminal user interface layout.

func UpdateDbase

func UpdateDbase() (err error)

UpdateDbase attempts to try and update user's local dictionary database, by first checking for database files that have changed on the remote repository and then download those files if any.

Types

type Definition

type Definition struct {
	PartOfSpeech   string `json:"part_of_speech"`
	WordDefinition string `json:"definition"`
}

type DictEntity

type DictEntity struct {
	Word            string       `json:"word"`
	Spellings       []string     `json:"alternate_spellings,omitempty"`
	WordDefinitions []Definition `json:"definitions"`
}

DictEntity represents the structure of elements/entities in the dictionary database.

Jump to

Keyboard shortcuts

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