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

uniform the api

This commit is contained in:
Wang Bin
2015-03-30 17:52:09 +08:00
parent 7a7f8af517
commit c397cafe8a
4 changed files with 50 additions and 28 deletions

View File

@@ -276,7 +276,7 @@ func chanToArray(ch chan Pair) []Pair {
}
func TestCut(t *testing.T) {
p, err := NewPosseg("../dict.txt")
p, err := Open("../dict.txt")
if err != nil {
t.Fatal(err)
}
@@ -307,7 +307,7 @@ func TestBug132(t *testing.T) {
/*
https://github.com/fxsjy/jieba/issues/132
*/
p, _ := NewPosseg("../dict.txt")
p, _ := Open("../dict.txt")
sentence := "又跛又啞"
cutResult := []Pair{
Pair{"又", "d"},
@@ -330,7 +330,7 @@ func TestBug137(t *testing.T) {
/*
https://github.com/fxsjy/jieba/issues/137
*/
p, _ := NewPosseg("../dict.txt")
p, _ := Open("../dict.txt")
sentence := "前港督衛奕信在八八年十月宣布成立中央政策研究組"
cutResult := []Pair{
Pair{"前", "f"},
@@ -359,7 +359,7 @@ func TestBug137(t *testing.T) {
}
func TestUserDict(t *testing.T) {
p, _ := NewPosseg("../dict.txt")
p, _ := Open("../dict.txt")
p.LoadUserDict("../userdict.txt")
sentence := "李小福是创新办主任也是云计算方面的专家; 什么是八一双鹿例如我输入一个带“韩玉赏鉴”的标题在自定义词库中也增加了此词为N类型"