1
0
mirror of https://github.com/fumiama/jieba.git synced 2026-06-27 23:50:33 +08:00

优化 tag_extracker

This commit is contained in:
源文雨
2022-11-30 13:35:21 +08:00
parent ae85ccb20a
commit d487545eb5
14 changed files with 60 additions and 62 deletions

View File

@@ -106,7 +106,8 @@ func (u *undirectWeightedGraph) rank() Segments {
result := make(Segments, len(ws))
i := 0
for n, w := range ws {
result[i] = &Segment{text: n, weight: (w - minRank/10.0) / (maxRank - minRank/10.0)}
result[i].text = n
result[i].weight = (w - minRank/10.0) / (maxRank - minRank/10.0)
i++
}
sort.Sort(sort.Reverse(result))