1
0
mirror of https://github.com/fumiama/jieba.git synced 2026-06-28 16:10:32 +08:00

优化 TextRanker

This commit is contained in:
源文雨
2022-11-30 12:56:04 +08:00
parent 21cdb2e863
commit a8d1e81f73
3 changed files with 16 additions and 15 deletions

View File

@@ -23,8 +23,10 @@ var (
)
func TestTextRank(t *testing.T) {
var tr TextRanker
tr.LoadDictionary("../dict.txt")
tr, err := LoadDictionary("../dict.txt")
if err != nil {
t.Fatal(err)
}
results := tr.TextRank(sentence, 10)
for index, tw := range results {
if tw.text != tagRanks[index].text || math.Abs(tw.weight-tagRanks[index].weight) > 1e-6 {