1
0
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:
Wang Bin
2015-01-26 18:31:10 +08:00
parent 2b15490388
commit b828b25f67
3 changed files with 67 additions and 16 deletions

View File

@@ -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])
}
}
}
}