From: Eevee Date: Fri, 16 Apr 2010 03:05:31 +0000 (-0700) Subject: roomaji.py now handles "wu xe" and "shi xi" correctly. #132 X-Git-Tag: veekun-promotions/2010050901~49 X-Git-Url: http://git.veekun.com/zzz-pokedex.git/commitdiff_plain/c4b6240ff0e07f2365d0a4e7de3a879bd80dc01c?ds=inline;hp=-c roomaji.py now handles "wu xe" and "shi xi" correctly. #132 --- c4b6240ff0e07f2365d0a4e7de3a879bd80dc01c diff --git a/pokedex/roomaji.py b/pokedex/roomaji.py index cdf30b5..95d559a 100644 --- a/pokedex/roomaji.py +++ b/pokedex/roomaji.py @@ -55,12 +55,21 @@ _roomaji_small_kana = { u'ァ': 'a', u'ィ': 'i', u'ゥ': 'u', u'ェ': 'e', u'ォ': 'o', } _roomaji_small_kana_combos = { - u'ウィ': 'wi', + # These are, by the way, fairly arbitrary. "shi xi" to mean "sy" is + # particularly weird, but it seems to be what GF intends + + # Simple vowel replacement + u'ウィ': 'wi', u'ウゥ': 'wu', u'ウェ': 'we', u'チェ': 'che', u'シェ': 'she', u'テァ': 'tha', u'ティ': 'ti', u'テゥ': 'thu', u'テェ': 'tye', u'テォ': 'tho', u'デァ': 'dha', u'ディ': 'di', u'デゥ': 'dhu', u'デェ': 'dye', u'デォ': 'dho', u'ファ': 'fa', u'フィ': 'fi', u'ホゥ': 'hu', u'フェ': 'fe', u'フォ': 'fo', + + # Not so much + u'シィ': 'sy', + u'ビィ': 'by', + u'ピィ': 'py', } def romanize(string): diff --git a/pokedex/tests/test_roomaji.py b/pokedex/tests/test_roomaji.py index 07a6aa7..09dfe71 100644 --- a/pokedex/tests/test_roomaji.py +++ b/pokedex/tests/test_roomaji.py @@ -17,10 +17,12 @@ def test_roomaji(): (u'ニャース', 'nyaasu'), (u'ジャ', 'ja'), (u'ぎゃくてん', 'gyakuten'), + (u'ウェザーボール', 'wezaabooru'), # Special katakana combinations (u'ラティアス', 'ratiasu'), (u'ウィー', 'wii'), + (u'セレビィ', 'sereby'), ] for kana, roomaji in tests: