mirror of
https://github.com/fumiama/jieba.git
synced 2026-06-23 04:30:44 +08:00
drop chan in DictLoader
This commit is contained in:
@@ -15,9 +15,9 @@ type Dictionary struct {
|
||||
}
|
||||
|
||||
// Load loads all tokens from given channel
|
||||
func (d *Dictionary) Load(ch <-chan dictionary.Token) {
|
||||
func (d *Dictionary) Load(tokens ...dictionary.Token) {
|
||||
d.Lock()
|
||||
for token := range ch {
|
||||
for _, token := range tokens {
|
||||
d.addToken(token)
|
||||
}
|
||||
d.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user