mirror of
https://github.com/fumiama/jieba.git
synced 2026-06-05 00:32:51 +08:00
small refactor according to go vet check results
This commit is contained in:
@@ -38,7 +38,7 @@ func (i *Idf) loadDictionary(fileName string) error {
|
||||
return dictionary.LoadDictionary(i, fileName)
|
||||
}
|
||||
|
||||
func (i Idf) Frequency(key string) (float64, bool) {
|
||||
func (i *Idf) Frequency(key string) (float64, bool) {
|
||||
i.RLock()
|
||||
freq, ok := i.freqMap[key]
|
||||
i.RUnlock()
|
||||
|
||||
@@ -57,7 +57,7 @@ func NewStopWord() *StopWord {
|
||||
return s
|
||||
}
|
||||
|
||||
func (s StopWord) IsStopWord(word string) bool {
|
||||
func (s *StopWord) IsStopWord(word string) bool {
|
||||
s.RLock()
|
||||
_, ok := s.stopWordMap[word]
|
||||
s.RUnlock()
|
||||
|
||||
Reference in New Issue
Block a user