Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bububa committed Jul 23, 2021
1 parent d965639 commit 34ad1ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion init.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package jiagu
import (
"compress/gzip"
"embed"
_ "embed"
"fmt"

"github.com/bububa/jiagu/perceptron"
Expand Down
6 changes: 6 additions & 0 deletions utils/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ func StringInSlice(arr []string, i int) string {
// StringSliceInRange 获取[]string中from-to位置字符串
func StringSliceInRange(arr []string, from int, to int) []string {
l := len(arr)
<<<<<<< HEAD
if from <= -1*l && to <= -1*l {
return []string{}
}
if from >= l {
return []string{}
}
=======
>>>>>>> f940ad9 (init commit)
return arr[idxInSlice(l, from) : idxInSlice(l, to-1)+1]
}

Expand All @@ -45,12 +48,15 @@ func RuneFromIndex(w []rune, i int) string {
// RuneInRange 从from到to截取字符串
func RuneInRange(w []rune, from int, to int) string {
l := len(w)
<<<<<<< HEAD
if from <= -1*l && to <= -1*l {
return ""
}
if from >= l {
return ""
}
=======
>>>>>>> f940ad9 (init commit)
return string(w[idxInSlice(l, from) : idxInSlice(l, to-1)+1])
}

Expand Down

0 comments on commit 34ad1ff

Please sign in to comment.