roomaji.py now handles "wu xe" and "shi xi" correctly. #132

This commit is contained in:
Eevee 2010-04-15 20:05:31 -07:00
parent 4ae8bb5f21
commit 1d9e24a875
2 changed files with 12 additions and 1 deletions

View file

@ -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):

View file

@ -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: