mirror of
https://github.com/fumiama/jieba.git
synced 2026-06-12 21:20:26 +08:00
small refactor, rename files
This commit is contained in:
@@ -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