1
0
mirror of https://github.com/fumiama/jieba.git synced 2026-06-05 00:32:51 +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

@@ -17,12 +17,8 @@ func (l *IDFLoader) AddEntry(entry *jiebago.Entry) {
}
func NewIDFLoader(IDFFileName string) (*IDFLoader, error) {
IDFFilePath, err := jiebago.DictPath(IDFFileName)
if err != nil {
return nil, err
}
loader := &IDFLoader{make(map[string]float64), 0.0, make([]float64, 0)}
err = jiebago.LoadDict(loader, IDFFilePath, false)
err = jiebago.LoadDict(loader, IDFFileName, false)
if err != nil {
return nil, err
}

View File

@@ -53,11 +53,7 @@ func NewStopWordLoader() *StopWordLoader {
// Set the stop words file path, could be absolute path of stop words file, or
// file name in current directory.
func (s *StopWordLoader) SetStopWords(stopWordsFileName string) error {
stopWordsFilePath, err := jiebago.DictPath(stopWordsFileName)
if err != nil {
return err
}
return jiebago.LoadDict(s, stopWordsFilePath, false)
return jiebago.LoadDict(s, stopWordsFileName, false)
}
func (s StopWordLoader) IsStopWord(word string) bool {