mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
roomaji.py now handles "wu xe" and "shi xi" correctly. #132
This commit is contained in:
parent
4ae8bb5f21
commit
1d9e24a875
2 changed files with 12 additions and 1 deletions
|
@ -55,12 +55,21 @@ _roomaji_small_kana = {
|
||||||
u'ァ': 'a', u'ィ': 'i', u'ゥ': 'u', u'ェ': 'e', u'ォ': 'o',
|
u'ァ': 'a', u'ィ': 'i', u'ゥ': 'u', u'ェ': 'e', u'ォ': 'o',
|
||||||
}
|
}
|
||||||
_roomaji_small_kana_combos = {
|
_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'チェ': 'che',
|
||||||
u'シェ': 'she',
|
u'シェ': 'she',
|
||||||
u'テァ': 'tha', u'ティ': 'ti', u'テゥ': 'thu', u'テェ': 'tye', u'テォ': 'tho',
|
u'テァ': 'tha', u'ティ': 'ti', u'テゥ': 'thu', u'テェ': 'tye', u'テォ': 'tho',
|
||||||
u'デァ': 'dha', u'ディ': 'di', u'デゥ': 'dhu', u'デェ': 'dye', u'デォ': 'dho',
|
u'デァ': 'dha', u'ディ': 'di', u'デゥ': 'dhu', u'デェ': 'dye', u'デォ': 'dho',
|
||||||
u'ファ': 'fa', u'フィ': 'fi', u'ホゥ': 'hu', u'フェ': 'fe', u'フォ': 'fo',
|
u'ファ': 'fa', u'フィ': 'fi', u'ホゥ': 'hu', u'フェ': 'fe', u'フォ': 'fo',
|
||||||
|
|
||||||
|
# Not so much
|
||||||
|
u'シィ': 'sy',
|
||||||
|
u'ビィ': 'by',
|
||||||
|
u'ピィ': 'py',
|
||||||
}
|
}
|
||||||
|
|
||||||
def romanize(string):
|
def romanize(string):
|
||||||
|
|
|
@ -17,10 +17,12 @@ def test_roomaji():
|
||||||
(u'ニャース', 'nyaasu'),
|
(u'ニャース', 'nyaasu'),
|
||||||
(u'ジャ', 'ja'),
|
(u'ジャ', 'ja'),
|
||||||
(u'ぎゃくてん', 'gyakuten'),
|
(u'ぎゃくてん', 'gyakuten'),
|
||||||
|
(u'ウェザーボール', 'wezaabooru'),
|
||||||
|
|
||||||
# Special katakana combinations
|
# Special katakana combinations
|
||||||
(u'ラティアス', 'ratiasu'),
|
(u'ラティアス', 'ratiasu'),
|
||||||
(u'ウィー', 'wii'),
|
(u'ウィー', 'wii'),
|
||||||
|
(u'セレビィ', 'sereby'),
|
||||||
]
|
]
|
||||||
|
|
||||||
for kana, roomaji in tests:
|
for kana, roomaji in tests:
|
||||||
|
|
Loading…
Reference in a new issue