1
0
mirror of https://github.com/fumiama/jieba.git synced 2026-06-05 08:40:36 +08:00

added benchmarks for posseg

This commit is contained in:
Wang Bin
2015-03-31 13:49:54 +08:00
parent 3852f660aa
commit 0ab9063f43

View File

@@ -412,3 +412,21 @@ func TestUserDict(t *testing.T) {
}
}
}
func BenchmarkCutNoHMM(b *testing.B) {
p, _ := Open("dict.txt")
sentence := "工信处女干事每月经过下属科室都要亲口交代24口交换机等技术性器件的安装工作"
b.ResetTimer()
for i := 0; i < b.N; i++ {
chanToArray(p.Cut(sentence, false))
}
}
func BenchmarkCut(b *testing.B) {
p, _ := Open("dict.txt")
sentence := "工信处女干事每月经过下属科室都要亲口交代24口交换机等技术性器件的安装工作"
b.ResetTimer()
for i := 0; i < b.N; i++ {
chanToArray(p.Cut(sentence, true))
}
}