mirror of
https://github.com/fumiama/jieba.git
synced 2026-06-28 08:02:45 +08:00
优化 Segmenter
This commit is contained in:
@@ -10,13 +10,13 @@ import (
|
||||
|
||||
// A Dictionary represents a thread-safe dictionary used for word segmentation.
|
||||
type Dictionary struct {
|
||||
sync.RWMutex
|
||||
total, logTotal float64
|
||||
freqMap map[string]float64
|
||||
posMap map[string]string
|
||||
sync.RWMutex
|
||||
}
|
||||
|
||||
// Load loads all tokens from given channel
|
||||
// Load loads all tokens
|
||||
func (d *Dictionary) Load(tokens ...dictionary.Token) {
|
||||
d.Lock()
|
||||
for _, token := range tokens {
|
||||
|
||||
Reference in New Issue
Block a user