(words []string)
| 57 | } |
| 58 | |
| 59 | func 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 | |
| 69 | func readRunes(words []string) [][]rune { |
| 70 | var dict [][]rune |
no test coverage detected