mirror of
https://github.com/fumiama/jieba.git
synced 2026-06-05 00:32:51 +08:00
small refactor, rename files
This commit is contained in:
1
jieba.go
1
jieba.go
@@ -9,7 +9,6 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
Dictionary = "dict.txt"
|
||||
UserWordTagTab = make(map[string]string)
|
||||
reEng = regexp.MustCompile(`[[:alnum:]]`)
|
||||
reHanCutAll = regexp.MustCompile(`\p{Han}+`)
|
||||
|
||||
@@ -20,6 +20,7 @@ var (
|
||||
reEng1 = regexp.MustCompile(`[[:alnum:]]$`)
|
||||
reHanInternal = regexp.MustCompile(`([\p{Han}+[:alnum:]+#&\._]+)`)
|
||||
reSkipInternal = regexp.MustCompile(`(\r\n|\s)`)
|
||||
dictionary = "dict.txt"
|
||||
)
|
||||
|
||||
type WordTag struct {
|
||||
@@ -33,7 +34,7 @@ func (wt WordTag) String() string {
|
||||
func init() {
|
||||
_, filename, _, _ := runtime.Caller(1)
|
||||
dict_dir := filepath.Dir(filepath.Dir(filename))
|
||||
dict_path := filepath.Join(dict_dir, jiebago.Dictionary)
|
||||
dict_path := filepath.Join(dict_dir, dictionary)
|
||||
err := load_model(dict_path)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
||||
Reference in New Issue
Block a user