go-ego / gse

Go efficient multilingual NLP and text segmentation; support English, Chinese, Japanese and others.
Apache License 2.0
2.57k stars 215 forks source link

Could not load dictionaries #25

Closed kooksee closed 3 years ago

kooksee commented 4 years ago

I pulled gse through go mod, but I found that the dictionary data in gse was not pulled down, so I found a "Could not load dictionaries" error. Then, I copied the dictionary data into the gse package to run it through. So, I think,

  1. Can you delete the hard-coded dictionary location in gse, or can it be configurable through parameters.
  2. If you want to load dictionary data, is it possible to convert the dictionary data into go static data code through "go-bindata" or other
vcaesar commented 4 years ago

Use go mod vendor? golang #26366.

kooksee commented 4 years ago

Thank you very much for answering my question. I have learned about go mod before. My solution is to put an init.go file in a static folder and then call this in a package such as gse file. In a nutshell, just treat static files as a go package, thanks.

vcaesar commented 3 years ago

You can use seg.LoadDictEmbed().

jw-star commented 3 years ago

You can use seg.LoadDictEmbed().

When I compile to binary, I can’t find the default dictionary

RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOARM=6 go build -ldflags '-w -s' -o main
vcaesar commented 3 years ago

@jw-star But there is due to can't reproduce.