matcher

package
v0.0.0-...-81c6b1d Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Matcher

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

Matcher 负责 Aho-Corasick 匹配器的管理

func NewMatcher

func NewMatcher(patterns []string) *Matcher

NewMatcher 创建新的 Matcher 实例

func (*Matcher) GetPatterns

func (m *Matcher) GetPatterns() []string

GetPatterns 返回当前匹配器的所有模式

func (*Matcher) Match

func (m *Matcher) Match(input string) []int

Match 匹配字符串,返回匹配的索引

func (*Matcher) UpdatePatterns

func (m *Matcher) UpdatePatterns(patterns []string)

UpdatePatterns 更新匹配器的模式

Jump to

Keyboard shortcuts

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