mirror of
https://github.com/fumiama/jieba.git
synced 2026-06-25 06:09:44 +08:00
small refactor the interface, use contructors instead of pointers for entry
This commit is contained in:
@@ -11,7 +11,7 @@ type IDFLoader struct {
|
||||
freqs []float64
|
||||
}
|
||||
|
||||
func (l *IDFLoader) AddEntry(entry *jiebago.Entry) {
|
||||
func (l *IDFLoader) AddEntry(entry jiebago.Entry) {
|
||||
l.IDFFreq[entry.Word] = entry.Freq
|
||||
l.freqs = append(l.freqs, entry.Freq)
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ type StopWordLoader struct {
|
||||
stopWords map[string]int
|
||||
}
|
||||
|
||||
func (s *StopWordLoader) AddEntry(entry *jiebago.Entry) {
|
||||
func (s *StopWordLoader) AddEntry(entry jiebago.Entry) {
|
||||
s.stopWords[entry.Word] = 1
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user