Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetCacheReg ¶
func SetCacheTree ¶
func SetDefaultReg ¶
func SetDefaultReg(tree *MatchReg)
func SetDefaultTree ¶
func SetDefaultTree(tree *MatchTree)
Types ¶
type Match ¶
type Match struct { Start int `json:"start"` // 起始位置 End int `json:"end"` // 结束位置 Word string `json:"word"` // 匹配到的词 Fuzzy bool `json:"fuzzy,omitempty"` // 是否模糊匹配 RegExp string `json:"reg_exp,omitempty"` // 模糊匹配使用的正则表达式 }
Match 匹配的结果数据结构
type MatchReg ¶
type MatchReg struct {
// contains filtered or unexported fields
}
MatchReg 正则匹配2
func GetCacheReg ¶
func GetDefaultReg ¶
func GetDefaultReg() *MatchReg
func (*MatchReg) ReplaceAll ¶
ReplaceAll 全部替换
type MatchTree ¶
type MatchTree struct {
// contains filtered or unexported fields
}
MatchTree 精确匹配搜索树,用于对指定列表中的字符串进行精确匹配
func GetCacheTree ¶
func GetDefaultTree ¶
func GetDefaultTree() *MatchTree
func (*MatchTree) ReplaceAll ¶
ReplaceAll 替换全部敏感词为repl
Click to show internal directories.
Click to hide internal directories.