From a9d85dc720e7b46c90f1efa1005b23e517415aa0 Mon Sep 17 00:00:00 2001 From: stephenmk Date: Fri, 3 Feb 2023 22:07:41 -0600 Subject: [PATCH] Simplify string -> runes conversion --- jmnedict_text_util.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/jmnedict_text_util.go b/jmnedict_text_util.go index b7b2122..610c7aa 100644 --- a/jmnedict_text_util.go +++ b/jmnedict_text_util.go @@ -44,10 +44,7 @@ func replaceIterationMarks(text string) string { // Returns nil if no segmentation is possible. func makeKanaSegments(kana string) (segments []string) { hiragana := replaceIterationMarks(katakanaToHiragana(kana)) - kanaRunes := []rune{} - for _, kanaRune := range hiragana { - kanaRunes = append(kanaRunes, kanaRune) - } + kanaRunes := []rune(hiragana) kanaRuneCount := len(kanaRunes) for i := 0; i < kanaRuneCount; i++ { for j := 0; j < kanaRuneCount-i; j++ {