MCPcopy Index your code
hub / github.com/dnote/dnote / tokenize

Function tokenize

pkg/cli/cmd/find/lexer.go:83–97  ·  view source on GitHub ↗

tokenize lexically analyzes the given matched snippet from a full text search and builds a slice of tokens

(s string)

Source from the content-addressed store, hash-verified

81// tokenize lexically analyzes the given matched snippet from a full text search
82// and builds a slice of tokens
83func tokenize(s string) []token {
84 var ret []token
85
86 idx := 0
87 for idx != -1 {
88 var tok token
89 tok, idx = scanToken(idx, s)
90
91 ret = append(ret, tok)
92 }
93
94 ret = append(ret, token{Kind: tokenKindEOL})
95
96 return ret
97}

Callers 2

formatFTSSnippetFunction · 0.85
TestTokenizeFunction · 0.85

Calls 1

scanTokenFunction · 0.85

Tested by 1

TestTokenizeFunction · 0.68