1
0
Fork 0
mirror of https://github.com/veekun/pokedex.git synced 2024-08-20 18:16:34 +00:00

Added foreign move names. Japanese only so far.

Also fixed roomaji conversion to not die spectacularly when given
hiragana.  For some reason I let it know about hiragana soukuon and
youon, but nothing else, so it gets totally confused.
This commit is contained in:
Eevee 2009-09-13 21:06:15 -07:00
parent fce02ad9eb
commit 990469bcd5
3 changed files with 482 additions and 4 deletions
pokedex

View file

@ -22,7 +22,7 @@ _roomaji_kana = {
_roomaji_youon = {
u'': 'ya', u'': 'yu', u'': 'yo',
u'': 'ya', u'': 'yu', u'': 'yo',
#u'ゃ': 'ya', u'ゅ': 'yu', u'ょ': 'yo',
}
# XXX If romanize() ever handles hiragana, it will need to make sure that the
@ -73,7 +73,7 @@ def romanize(string):
# Youon
elif char in _roomaji_youon:
if last_kana[-1] != 'i' or last_kana == 'i':
if not last_kana or last_kana[-1] != 'i' or last_kana == 'i':
raise ValueError("Youon must follow an -i sound.")
# Drop the -i and append the ya/yu/yo sound
@ -88,7 +88,8 @@ def romanize(string):
last_kana = new_char
# Sokuon
elif char in (u'', u''):
#elif char in (u'っ', u'ッ'):
elif char in (u'',):
# Remember it and double the consonant next time around
last_kana = 'sokuon'