Closed jw-star closed 3 years ago
SAME QUESTION
我也是同样的问题,这是为啥?没有 defer x.Free() 反而是正常的。
func init() { //本地开发使用 if DevelopmentStage { JiebaObj = gojieba.NewJieba() } else { //编译部署测试服,生产服使用 //从程序运行的当前目录下的dict文件夹中读取utf8文件 dictDir := path.Join(filepath.Dir(os.Args[0]), "dict") jiebaPath := path.Join(dictDir, "jieba.dict.utf8") hmmPath := path.Join(dictDir, "hmm_model.utf8") userPath := path.Join(dictDir, "user.dict.utf8") idfPath := path.Join(dictDir, "idf.utf8") stopPath := path.Join(dictDir, "stop_words.utf8") JiebaObj = gojieba.NewJieba(jiebaPath, hmmPath, userPath, idfPath, stopPath) }
————————————————
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/rgc_520_zyl/article/details/126040494
我这样尝试了,但是调用失败