MCPcopy Create free account
hub / github.com/bytebase/bytebase / splitCamelCase

Function splitCamelCase

backend/api/mcp/openapi_index.go:247–272  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

245}
246
247func splitCamelCase(s string) []string {
248 var words []string
249 var current strings.Builder
250
251 for _, r := range s {
252 if r >= 'A' && r <= 'Z' {
253 if current.Len() > 0 {
254 words = append(words, current.String())
255 current.Reset()
256 }
257 current.WriteRune(r)
258 } else if r >= 'a' && r <= 'z' || r >= '0' && r <= '9' {
259 current.WriteRune(r)
260 } else if current.Len() > 0 {
261 // Non-alphanumeric, flush current word
262 words = append(words, current.String())
263 current.Reset()
264 }
265 }
266
267 if current.Len() > 0 {
268 words = append(words, current.String())
269 }
270
271 return words
272}
273
274func isStopWord(word string) bool {
275 stopWords := map[string]bool{

Callers 1

extractKeywordsFunction · 0.85

Calls 3

LenMethod · 0.80
StringMethod · 0.65
ResetMethod · 0.45

Tested by

no test coverage detected