Skip to content

Commit 6251477

Browse files
author
willzhen
committed
Update model name
1 parent a991b65 commit 6251477

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

aho_automaton.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package text
1+
package textalg
22

33
import "github.com/eapache/queue"
44

edit_distance.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package text
1+
package textalg
22

33
func min(a, b int) int {
44
if a < b {

slice_same.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package text
1+
package textalg
22

33
import "sort"
44

text_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
package text_test
1+
package textalg_test
22

33
import (
44
"testing"
55

6-
"github.com/memory-overflow/go-text-algorithm"
6+
textalg "github.com/memory-overflow/go-text-algorithm"
77
)
88

99
func TestActrie(t *testing.T) {
10-
ac := text.BuildAcTrie([]string{"哈哈哈", "234", "dfg"})
10+
ac := textalg.BuildAcTrie([]string{"哈哈哈", "234", "dfg"})
1111
list, index := ac.Search("哈哈哈哈23434dfgdd")
1212
for i, l := range list {
1313
t.Log(l, index[i])
1414
}
1515
}
1616

1717
func TestTextSim(t *testing.T) {
18-
sim := text.TextSim("编辑距离测试", "测试一下距离")
18+
sim := textalg.TextSim("编辑距离测试", "测试一下距离")
1919
if sim != 0 {
2020
t.Error("Failed")
2121
}
2222
}
2323

2424
func TestLevenshtein(t *testing.T) {
25-
dist := text.Levenshtein([]rune("编辑距离测试"), []rune("测试一下距离"))
25+
dist := textalg.Levenshtein([]rune("编辑距离测试"), []rune("测试一下距离"))
2626
t.Logf("dist: %d", dist)
2727
}
2828

2929
func TestSliceSmae(t *testing.T) {
3030
a := []string{"3", "2", "1"}
31-
same := text.SliceSame(a, a)
31+
same := textalg.SliceSame(a, a)
3232
t.Logf("is same: %v", same)
3333
// test can not change order of a
3434
t.Log(a)

0 commit comments

Comments
 (0)