From 211f67614b254a9830e3c742d4d2cafc1d433fa1 Mon Sep 17 00:00:00 2001 From: vcaesar Date: Tue, 30 Jun 2020 11:38:41 -0400 Subject: [PATCH] add more test code --- phrase/paragraph_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/phrase/paragraph_test.go b/phrase/paragraph_test.go index 83cb955..cea5832 100644 --- a/phrase/paragraph_test.go +++ b/phrase/paragraph_test.go @@ -39,8 +39,10 @@ func TestParagraph(t *testing.T) { } func TestPinyin(t *testing.T) { - seg := gse.New() + seg := gse.New("zh, ../examples/dict.txt") WithGse(seg) - p := Pinyin("西雅图太空针") - tt.Equal(t, "[xi ya tu tai kong zhen]", p) + + AddDict("都会区", "dū huì qū") + p := Pinyin("西雅图都会区, 西雅图太空针") + tt.Equal(t, "[xi ya tu du hui qu, xi ya tu tai kong zhen]", p) }