1
0
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:
Wang Bin
2015-02-26 11:12:05 +08:00
parent c7218ce886
commit 95a27da5cf
3 changed files with 2 additions and 2 deletions

View File

@@ -9,7 +9,6 @@ import (
)
var (
Dictionary = "dict.txt"
UserWordTagTab = make(map[string]string)
reEng = regexp.MustCompile(`[[:alnum:]]`)
reHanCutAll = regexp.MustCompile(`\p{Han}+`)

View File

@@ -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)