diff options
| author | Sho Sakuma <me@m1sk9.dev> | 2026-01-20 20:36:23 +0900 |
|---|---|---|
| committer | Sho Sakuma <me@m1sk9.dev> | 2026-01-20 20:36:23 +0900 |
| commit | 6e4a53b97891e3b2a69050936a182c0fe55b72d6 (patch) | |
| tree | 2570d799b5beb3f710e2baee1d46fd7cba81bbec /engine | |
| parent | 3b1d35deb3488428dfcff0cd8448c0b0ed620903 (diff) | |
| download | LunaticChat-6e4a53b97891e3b2a69050936a182c0fe55b72d6.tar.gz LunaticChat-6e4a53b97891e3b2a69050936a182c0fe55b72d6.tar.bz2 LunaticChat-6e4a53b97891e3b2a69050936a182c0fe55b72d6.zip | |
fix: Fix Kana conversion with voiced consonants
Diffstat (limited to 'engine')
| -rw-r--r-- | engine/src/main/kotlin/dev/m1sk9/lunaticChat/engine/converter/KanaConverter.kt | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/engine/src/main/kotlin/dev/m1sk9/lunaticChat/engine/converter/KanaConverter.kt b/engine/src/main/kotlin/dev/m1sk9/lunaticChat/engine/converter/KanaConverter.kt index 47ab960..1b3c67d 100644 --- a/engine/src/main/kotlin/dev/m1sk9/lunaticChat/engine/converter/KanaConverter.kt +++ b/engine/src/main/kotlin/dev/m1sk9/lunaticChat/engine/converter/KanaConverter.kt @@ -20,6 +20,20 @@ object KanaConverter { private fun buildTrie(): TrieNode { val mappings = listOf( + // 4文字変換 (x/l prefix small characters) + "xtsu" to "っ", + "ltsu" to "っ", + // 3文字変換 (x/l prefix small characters) + "xtu" to "っ", + "ltu" to "っ", + "xya" to "ゃ", + "lya" to "ゃ", + "xyu" to "ゅ", + "lyu" to "ゅ", + "xyo" to "ょ", + "lyo" to "ょ", + "xwa" to "ゎ", + "lwa" to "ゎ", // 3文字変換 "kya" to "きゃ", "kyi" to "きぃ", @@ -104,6 +118,17 @@ object KanaConverter { "whi" to "うぃ", "whe" to "うぇ", "who" to "うぉ", + // 2文字変換 (x/l prefix small vowels) + "xa" to "ぁ", + "la" to "ぁ", + "xi" to "ぃ", + "li" to "ぃ", + "xu" to "ぅ", + "lu" to "ぅ", + "xe" to "ぇ", + "le" to "ぇ", + "xo" to "ぉ", + "lo" to "ぉ", // 2文字変換 "ka" to "か", "ki" to "き", @@ -181,11 +206,6 @@ object KanaConverter { "wu" to "う", "we" to "ゑ", "wo" to "を", - "la" to "ら", - "li" to "り", - "lu" to "る", - "le" to "れ", - "lo" to "ろ", "nn" to "ん", // 1文字変換 "a" to "あ", |
