package czech import ( "strings" "unicode" "golang.org/x/text/unicode/norm" ) // Normalize strips diacritics and lowercases s. // // Matches Python: unicodedata.normalize("NFKD", s) then filter out // combining characters (unicode.Mn only — not Mc/Me, which have // combining class 0 in Python's unicodedata.combining()). func Normalize(s string) string { decomposed := norm.NFKD.String(s) var b strings.Builder b.Grow(len(decomposed)) for _, r := range decomposed { if unicode.In(r, unicode.Mn) { continue } b.WriteRune(r) } return strings.ToLower(b.String()) }