summaryrefslogtreecommitdiff
path: root/engine/src/main/kotlin/dev
diff options
context:
space:
mode:
authorSho Sakuma <me@m1sk9.dev>2026-01-20 21:07:38 +0900
committerGitHub <noreply@github.com>2026-01-20 21:07:38 +0900
commit491420e94db9b21d350ee49df45eb129dec960d2 (patch)
tree7828da3e59c677d7778786586bb9c95061b82df5 /engine/src/main/kotlin/dev
parent3b1d35deb3488428dfcff0cd8448c0b0ed620903 (diff)
parent061bd455faad138ca1aefeb73be534198a4e0a44 (diff)
downloadLunaticChat-0.4.1.tar.gz
LunaticChat-0.4.1.tar.bz2
LunaticChat-0.4.1.zip
Merge pull request #49 from m1sk9/fix-kana-conversionv0.4.1
fix: Fix Kana conversion with voiced consonants
Diffstat (limited to 'engine/src/main/kotlin/dev')
-rw-r--r--engine/src/main/kotlin/dev/m1sk9/lunaticChat/engine/converter/KanaConverter.kt30
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 "あ",