1
0
mirror of https://github.com/fumiama/jieba.git synced 2026-06-22 12:10:30 +08:00

change cut method to return a channel string, not []string

This commit is contained in:
Wang Bin
2015-02-27 11:37:55 +08:00
parent 87fe3a19f8
commit 76b9df8511
4 changed files with 91 additions and 80 deletions

View File

@@ -36,10 +36,9 @@ func (tis TfIdfs) Swap(i, j int) {
}
func ExtractTags(sentence string, topK int) (tags TfIdfs) {
words := jiebago.Cut(sentence, false, true)
freq := make(map[string]float64)
for _, w := range words {
for w := range jiebago.Cut(sentence, false, true) {
w = strings.TrimSpace(w)
if utf8.RuneCountInString(w) < 2 {
continue