MCPcopy Index your code
hub / github.com/TruthHun/BookStack / SegWords

Function SegWords

utils/util.go:1108–1118  ·  view source on GitHub ↗

SegWords 分词

(sentence string, length ...int)

Source from the content-addressed store, hash-verified

1106
1107// SegWords 分词
1108func SegWords(sentence string, length ...int) (words []string) {
1109 topk := 5
1110 if len(length) > 0 && length[0] > 0 {
1111 topk = length[0]
1112 }
1113 tags := te.ExtractTags(sentence, topk)
1114 for _, tag := range tags {
1115 words = append(words, tag.Text())
1116 }
1117 return
1118}
1119
1120// LongestCommonPrefix 查找最长共同前缀
1121func LongestCommonPrefix(strs []string) string {

Callers 1

CreateMethod · 0.92

Calls 1

appendFunction · 0.50

Tested by

no test coverage detected