1
0
mirror of https://github.com/fumiama/jieba.git synced 2026-06-13 13:40:28 +08:00

move dictPath function private

This commit is contained in:
Wang Bin
2015-03-30 11:02:57 +08:00
parent 79adffe328
commit a66bf2a0bd
4 changed files with 12 additions and 16 deletions

View File

@@ -37,12 +37,11 @@ func (p *Posseg) AddEntry(entry *jiebago.Entry) {
func NewPosseg(dictFileName string) (*Posseg, error) {
j := &jiebago.Jieba{Total: 0.0, Freq: make(map[string]float64)}
p := &Posseg{j, make(map[string]string)}
dictFilePath, err := jiebago.DictPath(dictFileName)
err := jiebago.LoadDict(p, dictFileName, true)
if err != nil {
return nil, err
}
err = jiebago.LoadDict(p, dictFilePath, true)
return p, err
return p, nil
}
// Load user specified dictionary file.