(s string)
| 245 | } |
| 246 | |
| 247 | func 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 | |
| 274 | func isStopWord(word string) bool { |
| 275 | stopWords := map[string]bool{ |
no test coverage detected