mirror of
https://github.com/fumiama/jieba.git
synced 2026-07-01 17:40:29 +08:00
fix performance problem of extrag_tags, corresponding to jieba commit #eb98eb92484d3d302cd96049be43c224fe45414a
This commit is contained in:
@@ -185,6 +185,7 @@ var (
|
||||
func TestExtractTags(t *testing.T) {
|
||||
jiebago.SetDictionary("../dict.txt")
|
||||
SetIdf("idf.txt")
|
||||
|
||||
for index, sentence := range test_contents {
|
||||
result := ExtractTags(sentence, 20)
|
||||
if len(result) != len(Tags[index]) {
|
||||
@@ -192,8 +193,9 @@ func TestExtractTags(t *testing.T) {
|
||||
}
|
||||
for i, tag := range result {
|
||||
if tag != Tags[index][i] {
|
||||
t.Error(tag)
|
||||
t.Errorf("%s != %s", tag, Tags[index][i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user