From fb6a018f77eeb1b1d00c09c78c2ae3914d98a9f7 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Thu, 4 Jun 2026 15:03:02 +0900 Subject: [PATCH] =?UTF-8?q?kana=5Ftransliteration:=20handle=20elongated=20?= =?UTF-8?q?=E3=82=94,=E3=82=8E,=E3=82=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/kana_transliteration.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/kana_transliteration.rs b/src/kana_transliteration.rs index cee73d6..325657c 100644 --- a/src/kana_transliteration.rs +++ b/src/kana_transliteration.rs @@ -24,7 +24,7 @@ fn hiragana_vowel_map(hiragana: char) -> Option { match hiragana { 'あ' | 'ぁ' => Some('あ'), 'い' | 'ぃ' => Some('い'), - 'う' | 'ぅ' => Some('う'), + 'う' | 'ゔ' | 'ぅ' => Some('う'), 'え' | 'ぇ' => Some('え'), 'お' | 'ぉ' => Some('お'), 'か' | 'が' => Some('あ'), @@ -65,10 +65,11 @@ fn hiragana_vowel_map(hiragana: char) -> Option { 'る' => Some('う'), 'れ' => Some('え'), 'ろ' => Some('お'), - 'わ' => Some('あ'), + 'わ' | 'ゎ' => Some('あ'), 'ゐ' => Some('い'), 'ゑ' => Some('え'), 'を' => Some('お'), + 'ん' => Some('ん'), _ => None, } } @@ -77,7 +78,7 @@ fn katakana_vowel_map(katakana: char) -> Option { match katakana { 'ア' | 'ァ' => Some('ア'), 'イ' | 'ィ' => Some('イ'), - 'ウ' | 'ゥ' => Some('ウ'), + 'ウ' | 'ヴ' | 'ゥ' => Some('ウ'), 'エ' | 'ェ' => Some('エ'), 'オ' | 'ォ' => Some('オ'), 'カ' | 'ガ' => Some('ア'), @@ -118,10 +119,11 @@ fn katakana_vowel_map(katakana: char) -> Option { 'ル' => Some('ウ'), 'レ' => Some('エ'), 'ロ' => Some('オ'), - 'ワ' => Some('ア'), + 'ワ' | 'ヮ' => Some('ア'), 'ヰ' => Some('イ'), 'ヱ' => Some('エ'), 'ヲ' => Some('オ'), + 'ン' => Some('ン'), _ => None, } }