diff options
author | rtz12 <koenig@fagott.pw> | 2016-11-15 17:29:02 (UTC) |
---|---|---|
committer | rtz12 <koenig@fagott.pw> | 2016-11-15 17:29:02 (UTC) |
commit | 0ad174d7329e02b3f644614de0758789bb3677d4 (patch) | |
tree | e49a659c0b89bdec07cde778850b7fe002ac27ea /util/unicode.go | |
parent | e02ad854383265db216ed92b10c4f12408999d6a (diff) |
Verrückter Anilist Import
Bestes Feature 2k16.
Hashtag Make Grilist Great Again.
Diffstat (limited to 'util/unicode.go')
-rw-r--r-- | util/unicode.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/util/unicode.go b/util/unicode.go new file mode 100644 index 0000000..4432df5 --- /dev/null +++ b/util/unicode.go | |||
@@ -0,0 +1,15 @@ | |||
1 | package util | ||
2 | |||
3 | func NormalizeString(str string) string { | ||
4 | out := []rune{} | ||
5 | for _, r := range str { | ||
6 | if rpl, ok := unicodeConfusables[r]; ok { | ||
7 | for _, v := range rpl { | ||
8 | out = append(out, v) | ||
9 | } | ||
10 | } else { | ||
11 | out = append(out, r) | ||
12 | } | ||
13 | } | ||
14 | return string(out) | ||
15 | } | ||