🐛 兼容linux和windows文件换行不同 (#199)

This commit is contained in:
himawari
2022-04-19 23:00:01 +08:00
committed by GitHub
parent ccb58e0a6c
commit 3553683bb1

View File

@@ -48,7 +48,7 @@ func init() {
ctx.SendChain(message.Text("ERROR:", err))
return false
}
stopwords = strings.Split(binary.BytesToString(data), "\r\n")
stopwords = strings.Split(strings.ReplaceAll(binary.BytesToString(data), "\r", ""), "\n")
sort.Strings(stopwords)
logrus.Infoln("[wordcount]加载", len(stopwords), "条停用词")
return true