()
| 85 | } |
| 86 | |
| 87 | func loadDict() { |
| 88 | beego.Info("加载分词词典...") |
| 89 | dict := "dictionary/dictionary.txt" |
| 90 | err := seg.LoadDict(dict) |
| 91 | if err != nil { |
| 92 | beego.Error("加载分词词典失败!请在程序根目录启动程序", err.Error()) |
| 93 | } |
| 94 | seg.LoadStop("dictionary/stop_tokens.txt, dictionary/stop_word.txt") |
| 95 | te.WithGse(seg) |
| 96 | err = te.LoadIdf("dictionary/idf.txt") |
| 97 | if err != nil { |
| 98 | beego.Error("加载分词词典失败!请在程序根目录启动程序", err.Error()) |
| 99 | } |
| 100 | beego.Info("加载分词词典完成!") |
| 101 | } |
| 102 | |
| 103 | func PrintInfo() { |
| 104 | fmt.Println("Service: ", "BookStack") |