1
0
mirror of https://github.com/fumiama/jieba.git synced 2026-06-30 09:00:30 +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 { if err != nil {
t.Fatalf("Failed to load userdict.txt, err = %s", err) t.Fatalf("Failed to load userdict.txt, err = %s", err)
} }
if f, _ := d.Frequency("八一双鹿"); f != 3.0 { if _, ok := d.Frequency("八一双鹿"); !ok {
t.Fatalf("Wrong frequency for word \"八一双鹿\", expect 3.0, got %f", f) t.Fatalf("Failed to load userdict.txt, no frequency for word \"八一双鹿\"")
} }
} }