keyword

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_BASE_SIZE = 2

	CHARS_COUNT = 27
)

Variables

This section is empty.

Functions

func Search(str string) bool

关键字查询

func SetGlobal

func SetGlobal(key *KeyWord)

设置全局关键字

Types

type KeyWord

type KeyWord struct {
	SHIFT    map[string]*Shift   // key:字符块
	KEYS     []string            //所有匹配串
	PATTERNS map[string]*Pattern // key:匹配串  value:对应的pattern列表
	PREFIX   []*Prefix           //所有前缀

	KeySize    int //匹配串长度
	PrefixSize int //前缀块
	BaseSize   int //字符块长
}

func NewKeyWord

func NewKeyWord() *KeyWord

func (*KeyWord) Init

func (vk *KeyWord) Init(strs []string)

func (*KeyWord) Search

func (vk *KeyWord) Search(str string) bool

type Pattern

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

type Prefix

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

type Shift

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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