X-Git-Url: http://git.veekun.com/zzz-pokedex.git/blobdiff_plain/bfc084c8c47a48b686c79052d01c0a198cc59bc3..edd7978b6efc8a709a096f88ea19acfb65c719b8:/pokedex/roomaji.py diff --git a/pokedex/roomaji.py b/pokedex/roomaji.py index d0aa3ca..9db6b07 100644 --- a/pokedex/roomaji.py +++ b/pokedex/roomaji.py @@ -37,6 +37,7 @@ _roomaji_kana = { u'ダ': 'da', u'ヂ': 'ji', u'ヅ': 'dzu', u'デ': 'de', u'ド': 'do', u'バ': 'ba', u'ビ': 'bi', u'ブ': 'bu', u'ベ': 'be', u'ボ': 'bo', u'パ': 'pa', u'ピ': 'pi', u'プ': 'pu', u'ペ': 'pe', u'ポ': 'po', + u'ヴ': 'vu', } _roomaji_youon = { @@ -55,12 +56,23 @@ _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'ヴァ': 'va', u'ヴィ': 'vi', u'ヴェ': 've', u'ヴォ': 'vo', u'チェ': 'che', u'シェ': 'she', + u'ジェ': 'je', 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): @@ -113,8 +125,7 @@ def romanize(string): last_kana = new_char # Sokuon - #elif char in (u'っ', u'ッ'): - elif char in (u'ッ',): + elif char in (u'っ', u'ッ'): # Remember it and double the consonant next time around last_kana = 'sokuon'