| 2122 | } |
| 2123 | |
| 2124 | func metadataKeyWords(key string) []string { |
| 2125 | words := make([]string, 0, 4) |
| 2126 | var current strings.Builder |
| 2127 | |
| 2128 | flush := func() { |
| 2129 | if current.Len() == 0 { |
| 2130 | return |
| 2131 | } |
| 2132 | words = append(words, current.String()) |
| 2133 | current.Reset() |
| 2134 | } |
| 2135 | |
| 2136 | var prev rune |
| 2137 | var hasPrev bool |
| 2138 | for _, r := range key { |
| 2139 | if !unicode.IsLetter(r) { |
| 2140 | flush() |
| 2141 | hasPrev = false |
| 2142 | continue |
| 2143 | } |
| 2144 | |
| 2145 | if hasPrev && unicode.IsUpper(r) && unicode.IsLower(prev) { |
| 2146 | flush() |
| 2147 | } |
| 2148 | |
| 2149 | _, _ = current.WriteRune(unicode.ToLower(r)) |
| 2150 | prev = r |
| 2151 | hasPrev = true |
| 2152 | } |
| 2153 | |
| 2154 | flush() |
| 2155 | return words |
| 2156 | } |
| 2157 | |
| 2158 | func numericContextLimitValue(value any) (int64, bool) { |
| 2159 | switch typed := value.(type) { |