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:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user