acnode

package
v0.0.0-...-4ff491e Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckWordIN

func CheckWordIN(word string) string

改写后的函数,接受word参数,并返回处理结果

func CheckWordOUT

func CheckWordOUT(word string) string

改写后的函数,接受word参数,并返回处理结果

Types

type ACNode

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

type AhoCorasick

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

func NewAhoCorasick

func NewAhoCorasick() *AhoCorasick

func (*AhoCorasick) BuildFailPointer

func (ac *AhoCorasick) BuildFailPointer()

func (*AhoCorasick) FilterWithWhitelist

func (ac *AhoCorasick) FilterWithWhitelist(text string, whiteListedPositions []Position) string

func (*AhoCorasick) Insert

func (ac *AhoCorasick) Insert(word, replaceText string)

func (*AhoCorasick) MatchPositions

func (wac *AhoCorasick) MatchPositions(text string) []Position

type Position

type Position struct {
	Start int
	End   int
}

type Replacement

type Replacement struct {
	Start int    // 替换起始位置
	End   int    // 替换结束位置
	Text  string // 替换文本
}

Replacement结构体来记录替换信息

Jump to

Keyboard shortcuts

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