Documentation
¶
Overview ¶
Aho–Corasick algorithm Refer to https://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_algorithm https://www.youtube.com/watch?v=O7_w001f58c https://www.youtube.com/watch?v=OFKxWFew_L0
package sources defines the interface of a "dictionary", input a _string_, get the RAW content in the dictionary, might include the definitions/css files/renderers/...
Index ¶
- Variables
- func GetFromLDOCE(word string) string
- func LoadConfig() error
- func QueryByURL(word string) string
- func QueryMDX(word string, f string) string
- func Restore()
- func Store()
- type AhoCorasick
- type Config
- type DBDict
- type DBIExact
- type Dict
- type DictConfig
- type Dicts
- type Exact
- type IExact
- type Map
- type MdxDict
- type RawOutput
- type Searcher
- type Source
Constants ¶
This section is empty.
Variables ¶
View Source
var G = &Dicts{}
View Source
var Gbold = "**"
View Source
var Gitalic = "*"
Functions ¶
func GetFromLDOCE ¶
func LoadConfig ¶
func LoadConfig() error
func QueryByURL ¶
Types ¶
type AhoCorasick ¶
type AhoCorasick struct {
// contains filtered or unexported fields
}
func (*AhoCorasick) GetRawOutputs ¶
func (ack *AhoCorasick) GetRawOutputs(input string) []RawOutput
type Config ¶
type Config struct {
Dicts []DictConfig `json:"dicts"`
}
type DBDict ¶ added in v0.3.0
type DBDict struct {
}
func (*DBDict) WordsWithPrefix ¶ added in v0.3.0
type DBIExact ¶ added in v0.3.0
type DBIExact struct {
}
IExact is a case in-sensitive search source, no other fuzzy searching algos.
func (*DBIExact) GetRawOutputs ¶ added in v0.3.0
type DictConfig ¶ added in v0.0.7
type Exact ¶ added in v0.0.7
type Exact struct {
// contains filtered or unexported fields
}
Exact is a case sensitive search source, only matching the key(s) that is "exactly" the same
func (*Exact) GetRawOutputs ¶ added in v0.0.7
type IExact ¶ added in v0.2.0
type IExact struct {
// contains filtered or unexported fields
}
IExact is a case in-sensitive search source, no other fuzzy searching algos.
func (*IExact) GetRawOutputs ¶ added in v0.2.0
type MdxDict ¶
type MdxDict struct {
// SourceType
Type string
// For personal usage example, "oald9.json", or "Longman Dictionary of Contemporary English"
MdxFile string
MdxDict Dict // TODO: it's "embedded" in the searcher, maybe we can remove it to reduce mem usage when apply non-plain search algorithms.
// contains filtered or unexported fields
}
type Searcher ¶
func NewDBIExact ¶ added in v0.3.0
func NewDBIExact() Searcher
Click to show internal directories.
Click to hide internal directories.