mirror of
https://github.com/fumiama/jieba.git
synced 2026-06-23 12:40:39 +08:00
优化 dict, add fs.File 支持
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package analyse
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"sync"
|
||||
|
||||
"github.com/fumiama/jieba/dictionary"
|
||||
@@ -82,6 +83,10 @@ func (s *StopWord) Load(tokens ...dictionary.Token) {
|
||||
s.Unlock()
|
||||
}
|
||||
|
||||
func (s *StopWord) loadDictionary(fileName string) error {
|
||||
return dictionary.LoadDictionary(s, fileName)
|
||||
func (s *StopWord) loadDictionary(file fs.File) error {
|
||||
return dictionary.LoadDictionary(s, file)
|
||||
}
|
||||
|
||||
func (s *StopWord) loadDictionaryAt(file string) error {
|
||||
return dictionary.LoadDictionaryAt(s, file)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user