goseg
goseg copied to clipboard
package import path should not use relative paths
nnseg.go use a relative path for import gonn package, the method have a problem that make application developer can't use remote package directly.
e.g.
import (
"fmt"
"github.com/fxsjy/goseg/goseg"
)
var text = `透過攝取天然的食物、規律運動等,強化人體的免疫系統,自然能排出體內有害人體的代謝物質,不僅促進身體健康,整個人也會顯得精神奕奕。`
func main() {
for _, word := range goseg.Cut([]rune(text)) {
fmt.Println(word)
}
}
$ go build
test.go:5:2: local import "./gonn" in non-local package
the import path "./gonn" should replace by "github.com/fxsjy/goseg/goseg/gonn" in nnseg.go