wordset

package
v0.0.0-...-519aebc Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(config *idictconfig.Config, fs afero.Fs, wordSetImport *string, wordSetList *bool, wordSetShow *string, wordDel *string) func(*cobra.Command, []string) error

Types

type GuessWord

type GuessWord struct {
	Label string
	Value string
}

type Phrase

type Phrase struct {
	Word  string
	Text  string
	Trans string
}

type Pronounce

type Pronounce struct {
	Phonetic string
	Voice    string
}

type Sentence

type Sentence struct {
	Word  string
	Text  string
	Trans string
}

type Translate

type Translate struct {
	Part string
	Mean string
}

type Word

type Word struct {
	PronounceUS Pronounce
	PronounceUK Pronounce
	Text        string
	Translates  []Translate
	Phrases     []Phrase
	Sentences   []Sentence
}

type WordCache

type WordCache struct {
	StorageDir string
}

func NewWordCache

func NewWordCache(dir string) (WordCache, error)

func (WordCache) CacheDir

func (c WordCache) CacheDir() string

func (WordCache) Get

func (c WordCache) Get(text string) (Word, bool, error)

func (WordCache) Set

func (c WordCache) Set(word Word) error

type WordSet

type WordSet struct {
	Name       string
	Words      map[string]int
	StorageDir string
}

func NewWordSet

func NewWordSet(name, dir string) (WordSet, error)

func (*WordSet) Append

func (ws *WordSet) Append(word string) error

func (WordSet) Exist

func (ws WordSet) Exist() (bool, error)

func (*WordSet) Load

func (ws *WordSet) Load() error

func (WordSet) Save

func (ws WordSet) Save(force bool) error

type WordSetManage

type WordSetManage struct {
	StoragePath string
}

func (WordSetManage) Del

func (m WordSetManage) Del(name string) error

func (WordSetManage) Import

func (m WordSetManage) Import(p string) error

func (WordSetManage) List

func (m WordSetManage) List() error

func (WordSetManage) Show

func (m WordSetManage) Show(name string) error

func (WordSetManage) WordSetDir

func (m WordSetManage) WordSetDir() string

Jump to

Keyboard shortcuts

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