Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MatchResult ¶
type MatchResults ¶
type MatchResults []*MatchResult
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
func BuildNewMatcher ¶
func NewMatcher ¶
func NewMatcher() *Matcher
func (*Matcher) GetMatchResultSize ¶
just return the number of len(Match(s))
type Megaloscope ¶
type Megaloscope struct { AllWords WordSlice //所有词 AllWordsPY WordSlice //所有词的拼音 AllRules map[int]*Rule //所有词组 WordsMatcher *Matcher WordsPYMatcher *Matcher }
敏感词检测
func NewMegaloscope ¶
func NewMegaloscope(filepath string) *Megaloscope
func (*Megaloscope) Discern ¶
func (m *Megaloscope) Discern(src string, threads int) (ret MatchResults)
Discern 多线程扫描检查一篇文章,是否存在敏感词
Click to show internal directories.
Click to hide internal directories.