Files
go-ir-playground/internal/ngram/ngram_test.go
2024-02-16 20:43:26 +08:00

20 lines
307 B
Go

package ngram_test
import (
"testing"
"github.com/gslin/go-ir-playground/internal/ngram"
)
func TestUnigram(t *testing.T) {
a := ngram.Unigram("test")
if len(a) != 1 || a[0] != "test" {
t.Error()
}
a = ngram.Unigram("測試")
if len(a) != 2 || a[0] != "測" || a[1] != "試" {
t.Error()
}
}