Skip to content

Commit 14f9611

Browse files
committed
Add ml-inscript tests
1 parent afe1fa4 commit 14f9611

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package govarnamgo
2+
3+
import (
4+
"context"
5+
"testing"
6+
)
7+
8+
func TestMLInscriptTransilterateGreedyTokenized(t *testing.T) {
9+
varnam := getVarnamInstance("ml-inscript")
10+
11+
assertEqual(t, varnam.TransliterateGreedyTokenized("EnhdhgB")[0].Word, "ആലപ്പുഴ")
12+
}
13+
14+
func TestMLInscriptGetSuggestions(t *testing.T) {
15+
varnam := getVarnamInstance("ml-inscript")
16+
17+
varnam.Learn("ഇടുക്കി", 0)
18+
19+
sugs, err := varnam.GetSuggestions(
20+
context.Background(),
21+
varnam.TransliterateGreedyTokenized("F'")[0].Word, // ഇട
22+
)
23+
checkError(err)
24+
25+
assertEqual(t, sugs[0].Word, "ഇടുക്കി")
26+
}

govarnamgo/govarnamgo_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ func tearDown() {
6060

6161
func TestMain(m *testing.M) {
6262
setUp("ml")
63+
setUp("ml-inscript")
6364
m.Run()
6465
tearDown()
6566
}

0 commit comments

Comments
 (0)