1 Star 0 Fork 0

kardashian / sego

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
test_utils.go 744 Bytes
Copy Edit Raw Blame History
adamzy authored 2015-10-04 16:59 . use cedar as the dictionary
package sego
import (
"fmt"
"testing"
)
func expect(t *testing.T, expect string, actual interface{}) {
actualString := fmt.Sprint(actual)
if expect != actualString {
t.Errorf("期待值=\"%s\", 实际=\"%s\"", expect, actualString)
}
}
func printTokens(tokens []*Token, numTokens int) (output string) {
for iToken := 0; iToken < numTokens; iToken++ {
for _, word := range tokens[iToken].text {
output += fmt.Sprint(string(word))
}
output += " "
}
return
}
func toWords(strings ...string) []Text {
words := []Text{}
for _, s := range strings {
words = append(words, []byte(s))
}
return words
}
func bytesToString(bytes []Text) (output string) {
for _, b := range bytes {
output += (string(b) + "/")
}
return
}
Go
1
https://gitee.com/kardashian/sego.git
git@gitee.com:kardashian/sego.git
kardashian
sego
sego
master

Search

53164aa7 5694891 3bd8fe86 5694891