mirror of
https://github.com/fumiama/jieba.git
synced 2026-06-28 16:10:32 +08:00
优化 TextRanker
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user