1
0
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:
Wang Bin
2015-03-30 13:00:56 +08:00
parent 48a0bd390b
commit 51c63cb9ad
7 changed files with 274 additions and 283 deletions

View File

@@ -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)
}

View File

@@ -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
}