dicts

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2025 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagNoFuzzy uint16 = 2 << iota
	FlagNoStartWith
	FlagNoRegex
	FlagNoGlob
)

Variables

View Source
var (
	DictList        []common.Dictionary
	DictByName      = map[string]common.Dictionary{}
	DictsOrder      map[string]int
	DictSettingsMap = map[string]*DictionarySettings{}
)

Functions

func Hash

func Hash(info common.Dictionary) string

func InitDicts

func InitDicts(conf *config.Config)

func Reorder

func Reorder(order map[string]int)

func SaveDictsSettings

func SaveDictsSettings(settingsMap map[string]*DictionarySettings) error

Types

type DictionaryListSorter

type DictionaryListSorter struct {
	Order map[string]int
	List  []common.Dictionary
}

func (DictionaryListSorter) Len

func (s DictionaryListSorter) Len() int

func (DictionaryListSorter) Less

func (s DictionaryListSorter) Less(i, j int) bool

func (DictionaryListSorter) Swap

func (s DictionaryListSorter) Swap(i, j int)

type DictionarySettings

type DictionarySettings struct {
	Symbol string `json:"symbol"`
	Order  int    `json:"order"`
	Hash   string `json:"hash"`

	Flags uint16 `json:"flags,omitempty"`

	HideTermsHeader bool `json:"hide_terms_header,omitempty"`

	AudioVolume int `json:"audio_volume,omitempty"`
}

func NewDictSettings

func NewDictSettings(dic common.Dictionary, index int) *DictionarySettings

func (*DictionarySettings) Fuzzy

func (ds *DictionarySettings) Fuzzy() bool

func (*DictionarySettings) Glob

func (ds *DictionarySettings) Glob() bool

func (*DictionarySettings) Regex

func (ds *DictionarySettings) Regex() bool

func (*DictionarySettings) SetFuzzy

func (ds *DictionarySettings) SetFuzzy(enable bool)

func (*DictionarySettings) SetGlob

func (ds *DictionarySettings) SetGlob(enable bool)

func (*DictionarySettings) SetRegex

func (ds *DictionarySettings) SetRegex(enable bool)

func (*DictionarySettings) SetStartWith

func (ds *DictionarySettings) SetStartWith(enable bool)

func (*DictionarySettings) StartWith

func (ds *DictionarySettings) StartWith() bool

Jump to

Keyboard shortcuts

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