1
0
mirror of https://github.com/fumiama/jieba.git synced 2026-07-02 01:50:29 +08:00

code refactor, updated RegexpSplit function to match Python's re.split function

This commit is contained in:
Wang Bin
2015-04-02 18:25:00 +08:00
parent 0ab9063f43
commit 84ad6fe25e
5 changed files with 94 additions and 58 deletions

View File

@@ -283,7 +283,10 @@ func TestCut(t *testing.T) {
for index, content := range test_contents {
result := chanToArray(p.Cut(content, true))
if len(defaultCutResult[index]) != len(result) {
t.Fatal(content)
t.Errorf("default cut for %s length should be %d not %d\n",
content, len(defaultCutResult[index]), len(result))
t.Errorf("expect: %v\n", defaultCutResult[index])
t.Fatalf("got: %v\n", result)
}
for i, _ := range result {
if result[i] != defaultCutResult[index][i] {