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

added tests for dictionary.go, fixed a small bug

This commit is contained in:
Wang Bin
2015-04-30 11:03:54 +08:00
parent ae54d82c68
commit ac7628edaf

View File

@@ -28,8 +28,8 @@ func TestLoadUserDictionary(t *testing.T) {
if err != nil {
t.Fatalf("Failed to load userdict.txt, err = %s", err)
}
if f, _ := d.Frequency("八一双鹿"); f != 3.0 {
t.Fatalf("Wrong frequency for word \"八一双鹿\", expect 3.0, got %f", f)
if _, ok := d.Frequency("八一双鹿"); !ok {
t.Fatalf("Failed to load userdict.txt, no frequency for word \"八一双鹿\"")
}
}