var seg gse.Segmenter
func main() {
//load custom dict
seg.LoadDict("zh,./dict/zh/s_1.txt,./dict/zh/t_1.txt")
seg.LoadStop("./dict/zh/stop_word.txt")
fmt.Println(WordCut("这儿有一只大马猴"))
}
=============
After compiling with "go build", the program will run normally.But I put this program on a system without the go environment installed,The program still works,But there are some errors, as shown below:
2024/05/15 15:54:51 Dict files path: [c:/Goproj/pkg/mod/github.com/go-ego/gse@v0.80.2/data/dict/zh/t_1.txt c:/Goproj/pkg/mod/github.com/go-ego/gse@v0.80.2/data/dict/zh/s_1.txt ./dict/zh/s_1.txt ./dict/zh/t_1.txt]
2024/05/15 15:54:51 Load the gse dictionary: "c:/Goproj/pkg/mod/github.com/go-ego/gse@v0.80.2/data/dict/zh/t_1.txt"
2024/05/15 15:54:51 Could not load dictionaries: "c:/Goproj/pkg/mod/github.com/go-ego/gse@v0.80.2/data/dict/zh/t_1.txt", open c:/Goproj/pkg/mod/github.com/go-ego/gse@v0.80.2/data/dict/zh/t_1.txt: The system cannot find the path specified.
2024/05/15 15:54:51 Load the stop word dictionary: "./dict/zh/stop_word.txt"
[这儿 有 一 只 大马猴]
Here's my question:
1、How can I avoid this error?
2、What's the best thing to do?
Description
I use a custom dictionary,The code is follows:
var seg gse.Segmenter func main() { //load custom dict seg.LoadDict("zh,./dict/zh/s_1.txt,./dict/zh/t_1.txt") seg.LoadStop("./dict/zh/stop_word.txt")
}
============= After compiling with "go build", the program will run normally.But I put this program on a system without the go environment installed,The program still works,But there are some errors, as shown below:
2024/05/15 15:54:51 Dict files path: [c:/Goproj/pkg/mod/github.com/go-ego/gse@v0.80.2/data/dict/zh/t_1.txt c:/Goproj/pkg/mod/github.com/go-ego/gse@v0.80.2/data/dict/zh/s_1.txt ./dict/zh/s_1.txt ./dict/zh/t_1.txt] 2024/05/15 15:54:51 Load the gse dictionary: "c:/Goproj/pkg/mod/github.com/go-ego/gse@v0.80.2/data/dict/zh/t_1.txt" 2024/05/15 15:54:51 Could not load dictionaries: "c:/Goproj/pkg/mod/github.com/go-ego/gse@v0.80.2/data/dict/zh/t_1.txt", open c:/Goproj/pkg/mod/github.com/go-ego/gse@v0.80.2/data/dict/zh/t_1.txt: The system cannot find the path specified. 2024/05/15 15:54:51 Load the stop word dictionary: "./dict/zh/stop_word.txt" [这儿 有 一 只 大马猴]
Here's my question: 1、How can I avoid this error? 2、What's the best thing to do?
`