1
0
mirror of https://github.com/fumiama/jieba.git synced 2026-06-19 09:50:25 +08:00
This commit is contained in:
源文雨
2022-11-30 12:18:15 +08:00
parent ab8b95ef87
commit 8bbc755ed4
48 changed files with 984 additions and 859 deletions

4
analyse/tag_extracker.go Normal file → Executable file
View File

@@ -6,7 +6,7 @@ import (
"strings"
"unicode/utf8"
"github.com/wangbin/jiebago"
jiebago "github.com/fumiama/jieba"
)
// Segment represents a word with weight.
@@ -74,7 +74,7 @@ func (t *TagExtracter) LoadStopWords(fileName string) error {
func (t *TagExtracter) ExtractTags(sentence string, topK int) (tags Segments) {
freqMap := make(map[string]float64)
for w := range t.seg.Cut(sentence, true) {
for _, w := range t.seg.Cut(sentence, true) {
w = strings.TrimSpace(w)
if utf8.RuneCountInString(w) < 2 {
continue