commons

package module
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResultFlag_FixAudio = 1 << iota
	ResultFlag_FixFileSrc
	ResultFlag_FixWordLink
	ResultFlag_ColorMapping
	ResultFlag_Web
	ResultFlag_QTextBrowser
)

Variables

This section is empty.

Functions

func DefaultSymbol

func DefaultSymbol(dictName string) string

Types

type Dictionary

type Dictionary interface {
	Disabled() bool
	SetDisabled(bool)
	Loaded() bool
	Load() error
	Close()
	DictName() string
	EntryCount() (int, error)
	Description() string
	ResourceDir() string
	ResourceURL() string
	IndexPath() string
	IndexFileSize() uint64
	InfoPath() string
	CalcHash() ([]byte, error)
	EntryByIndex(int) *SearchResultLow
	SearchFuzzy(query string, workerCount int, timeout time.Duration) []*SearchResultLow
	SearchStartWith(query string, workerCount int, timeout time.Duration) []*SearchResultLow
	SearchRegex(query string, workerCount int, timeout time.Duration) ([]*SearchResultLow, error)
	SearchGlob(query string, workerCount int, timeout time.Duration) ([]*SearchResultLow, error)
	SearchWordMatch(query string, workerCount int, timeout time.Duration) []*SearchResultLow
	SearchExact(query string, workerCount int, timeout time.Duration) []*SearchResultLow
}

type SearchResultIface

type SearchResultIface interface {
	Terms() []string
	Score() uint8
	DictName() string
	DefinitionsHTML() []string
	ResourceDir() string
	EntryIndex() uint64
}

type SearchResultItem

type SearchResultItem struct {
	Data []byte
	Type rune
}

type SearchResultLow

type SearchResultLow struct {
	Items        func() []*SearchResultItem
	F_Terms      []string
	F_Score      uint8
	F_EntryIndex uint64
}

func (*SearchResultLow) EntryIndex

func (res *SearchResultLow) EntryIndex() uint64

func (*SearchResultLow) Score

func (res *SearchResultLow) Score() uint8

func (*SearchResultLow) Terms

func (res *SearchResultLow) Terms() []string

Directories

Path Synopsis
Implementation taken from https://gist.github.com/andrei-m/982927#gistcomment-1931258
Implementation taken from https://gist.github.com/andrei-m/982927#gistcomment-1931258

Jump to

Keyboard shortcuts

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