sensitive-word-detect

module
v0.0.0-...-60698ea Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: MIT

README

sensitive-word-detect

sensitive words detection

Golang version of observerss/textfilter

  • toy work for ByteDance backend trainingcamp
Example
package utils

import (
	"github.com/Karshilov/sensitive-word-detect/automaton"
	"github.com/Karshilov/sensitive-word-detect/utils"
)

var SensitiveWordsFilter = func() automaton.ACAutomaton {
	keywords, _ := utils.GetKeywords()
	ac := automaton.ACAutomaton{}
	ac.Reserve(1000000)
	for _, v := range keywords {
		ac.Insert(v)
	}
	ac.Build()
	return ac
}()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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