MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / InitAc

Function InitAc

service/str.go:59–67  ·  view source on GitHub ↗
(words []string)

Source from the content-addressed store, hash-verified

57}
58
59func InitAc(words []string) *goahocorasick.Machine {
60 m := new(goahocorasick.Machine)
61 dict := readRunes(words)
62 if err := m.Build(dict); err != nil {
63 fmt.Println(err)
64 return nil
65 }
66 return m
67}
68
69func readRunes(words []string) [][]rune {
70 var dict [][]rune

Callers 2

SensitiveWordReplaceFunction · 0.85
AcSearchFunction · 0.85

Calls 1

readRunesFunction · 0.85

Tested by

no test coverage detected