forked from crackcell/gonlpir
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gonlpir_test.go
57 lines (50 loc) · 1.35 KB
/
gonlpir_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/***************************************************************
*
* Copyright (c) 2015, Menglong TAN <tanmenglong@gmail.com>
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GPL licence
*
**************************************************************/
/**
*
*
* @file gonlpir_test.go
* @author Menglong TAN <tanmenglong@gmail.com>
* @date Sun Mar 8 15:40:16 2015
*
**/
package gonlpir
import (
"fmt"
"testing"
)
//===================================================================
// Public APIs
//===================================================================
func TestParagraphProcess(t *testing.T) {
nlpir, err := NewNLPIR(UTF8, "")
if err != nil {
t.Error(err)
return
}
defer nlpir.Exit()
fmt.Println("TestParagraphProcess: 我是中国人")
fmt.Println(nlpir.ParagraphProcess("我是中国人", true))
}
func TestParagraphProcessA(t *testing.T) {
nlpir, err := NewNLPIR(UTF8, "")
if err != nil {
t.Error(err)
return
}
defer nlpir.Exit()
fmt.Println("TestParagraphProcessA: 我是中国人")
results := nlpir.ParagraphProcessA("我是中国人", true)
for i := 0; i < len(results); i++ {
fmt.Printf("%#v\n", results[i])
}
}
//===================================================================
// Private
//===================================================================