tire

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GBK2UTF8

func GBK2UTF8(src []byte) (string, error)

GBK2UTF8 : transform GBK byte array into UTF8 string

func UTF82GBK

func UTF82GBK(src string) ([]byte, error)

UTF82GBK : transform UTF8 rune into GBK byte array

Types

type Chinese

type Chinese []string

func (Chinese) Len

func (a Chinese) Len() int

func (Chinese) Less

func (s Chinese) Less(i, j int) bool

func (Chinese) Swap

func (a Chinese) Swap(i, j int)

type TireFilter

type TireFilter interface {
	//过滤敏感词列表
	FilterResult(texts []string) [][]string
	FilterResultCount(texts []string) map[string]int
	GetRoot() *node
	Print()
}

func NewTireFilter

func NewTireFilter(text [][]string, ignoreOrder bool) TireFilter

NewTireFilter 创建节点过滤器,实现敏感词的过滤 从切片中读取敏感词数据

Jump to

Keyboard shortcuts

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