mydictionary

package module
v4.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 12 Imported by: 1

README

MYDICTIONARY

Get Started
Others
  • All code files are edited by Atom.
  • All ".md" files are edited by Typora.
  • The style of all ".md" files is Github Flavored Markdown.
  • There is a LF (Linux) at the end of each line.

Documentation

Index

Constants

View Source
const (
	// Basic : string for "Status" in "VocabularyAnswerStruct"
	Basic = "basic"
	// Advance : string for "Status" in "VocabularyAnswerStruct"
	Advance = "advance"
	// Collection : int for "TableType" in "LocationStruct"
	Collection = 1
	// Dictionary : int for "TableType" in "LocationStruct"
	Dictionary = 2
	// Online : int for "TableType" in "LocationStruct"
	Online = 3
)

Variables

View Source
var (

	// Setting : mydictionary setting
	Setting settingStruct
)

Functions

func CheckNetwork

func CheckNetwork() (success bool, information string)

CheckNetwork : check network

func Edit

func Edit(vocabularyEdit VocabularyEditStruct) (success bool, information string)

Edit : edit

func Initialize

func Initialize(path []string) (success bool, information string)

Initialize : initialize the library

func Save

func Save() (success bool, information string)

Save : save to .xlsx file

Types

type BingDictionaryStruct

type BingDictionaryStruct struct {
	// contains filtered or unexported fields
}

BingDictionaryStruct : Bing Dictionary struct

func (*BingDictionaryStruct) GetCache

func (service *BingDictionaryStruct) GetCache() (cache *CacheStruct)

GetCache : get cache

func (*BingDictionaryStruct) GetServiceName

func (service *BingDictionaryStruct) GetServiceName() (value string)

GetServiceName : get service name

func (*BingDictionaryStruct) Query

func (service *BingDictionaryStruct) Query(vocabularyAsk VocabularyAskStruct) (vocabularyAnswer VocabularyAnswerStruct)

Query : query vocabulary

type CacheItemStruct

type CacheItemStruct struct {
	QueryString  string   `json:"queryString"`
	Word         string   `json:"word"`
	Definition   []string `json:"definition"`
	Status       string   `json:"status"`
	CreationTime int64    `json:"creationTime"`
}

CacheItemStruct : item struct

type CacheStruct

type CacheStruct struct {
	Content []CacheItemStruct `json:"content"`
	// contains filtered or unexported fields
}

CacheStruct : cache struct

func (*CacheStruct) Add

func (cache *CacheStruct) Add(item CacheItemStruct)

Add : add item to cache

func (*CacheStruct) Query

func (cache *CacheStruct) Query(queryString string) (item CacheItemStruct, err error)

Query : query item in cache

func (*CacheStruct) Read

func (cache *CacheStruct) Read(path string, shelfLifeDay int64) (err error)

Read : read cache

func (*CacheStruct) Write

func (cache *CacheStruct) Write() (information string, err error)

Write : write cache

type IcibaCollinsStruct

type IcibaCollinsStruct struct {
	// contains filtered or unexported fields
}

IcibaCollinsStruct : iCIBA Collins struct

func (*IcibaCollinsStruct) GetCache

func (service *IcibaCollinsStruct) GetCache() (cache *CacheStruct)

GetCache : get cache

func (*IcibaCollinsStruct) GetServiceName

func (service *IcibaCollinsStruct) GetServiceName() (value string)

GetServiceName : get service name

func (*IcibaCollinsStruct) Query

func (service *IcibaCollinsStruct) Query(vocabularyAsk VocabularyAskStruct) (vocabularyAnswer VocabularyAnswerStruct)

Query : query vocabulary

type LocationStruct

type LocationStruct struct {
	TableType  int `json:"tableType"`
	TableIndex int `json:"tableIndex"`
	ItemIndex  int `json:"itemIndex"`
}

LocationStruct : location of vocabulary

type MerriamWebsterStruct

type MerriamWebsterStruct struct {
	// contains filtered or unexported fields
}

MerriamWebsterStruct : Merriam Webster struct

func (*MerriamWebsterStruct) GetCache

func (service *MerriamWebsterStruct) GetCache() (cache *CacheStruct)

GetCache : get cache

func (*MerriamWebsterStruct) GetServiceName

func (service *MerriamWebsterStruct) GetServiceName() (value string)

GetServiceName : get service name

func (*MerriamWebsterStruct) Query

func (service *MerriamWebsterStruct) Query(vocabularyAsk VocabularyAskStruct) (vocabularyAnswer VocabularyAnswerStruct)

Query : query vocabulary

type ServiceInterface

type ServiceInterface interface {
	GetServiceName() string
	GetCache() *CacheStruct
	Query(VocabularyAskStruct) VocabularyAnswerStruct
}

ServiceInterface : service interface

type VocabularyAnswerStruct

type VocabularyAnswerStruct struct {
	Word         string         `json:"word"`         // `xlsx:wd`
	Definition   []string       `json:"definition"`   // `xlsx:def`
	SerialNumber int            `json:"serialNumber"` // `xlsx:sn`
	QueryCounter int            `json:"queryCounter"` // `xlsx:qc`
	QueryTime    string         `json:"queryTime"`    // `xlsx:qt`
	Note         []string       `json:"note"`         // `xlsx:nt`
	SourceName   string         `json:"sourceName"`
	Status       string         `json:"status"`
	Location     LocationStruct `json:"location"`
}

VocabularyAnswerStruct : vocabulary, include word, definition, note and other information

type VocabularyAskStruct

type VocabularyAskStruct struct {
	Word        string `json:"word"`
	Advance     bool   `json:"advance"`
	Online      bool   `json:"online"`
	DoNotRecord bool   `json:"doNotRecord"`
}

VocabularyAskStruct : content and option for query

type VocabularyEditStruct

type VocabularyEditStruct struct {
	Location   LocationStruct `json:"location"`
	Definition string         `json:"definition"`
	Note       string         `json:"note"`
}

VocabularyEditStruct : editor for definition and note of vocabulary

type VocabularyResultStruct

type VocabularyResultStruct struct {
	Basic   []VocabularyAnswerStruct `json:"basic"`
	Advance []VocabularyAnswerStruct `json:"advance"`
}

VocabularyResultStruct : set of query result

func Query

func Query(vocabularyAsk VocabularyAskStruct) (success bool, vocabularyResult VocabularyResultStruct)

Query : query

Jump to

Keyboard shortcuts

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