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:
@@ -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 \"八一双鹿\"")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user