X-Git-Url: http://git.veekun.com/zzz-pokedex.git/blobdiff_plain/c4b6240ff0e07f2365d0a4e7de3a879bd80dc01c..9566a9dfe468d25f35f0d5b5d7f3d68c148b8aa5:/pokedex/roomaji.py diff --git a/pokedex/roomaji.py b/pokedex/roomaji.py index 95d559a..e91c960 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 = { @@ -59,15 +60,18 @@ _roomaji_small_kana_combos = { # particularly weird, but it seems to be what GF intends # Simple vowel replacement - u'ã¦ã£': 'wi', u'ã¦ã¥': 'wu', u'ã¦ã§': 'we', + u'ã¦ã£': 'wi', u'ã¦ã¥': 'wu', u'ã¦ã§': 'we', u'ã¦ã©': 'wo', + 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'ãã£': 'my', u'ãã£': 'by', u'ãã£': 'py', } @@ -82,11 +86,12 @@ def romanize(string): last_char = None # Used for small kana combos for char in string: # Full-width Latin - if ord(char) >= 0xff11 and ord(char) <= 0xff5e: + if 0xff01 <= ord(char) <= 0xff5e: if last_kana == 'sokuon': raise ValueError("Sokuon cannot precede Latin characters.") - char = chr(ord(char) - 0xff11 + 0x31) + # XXX Real Unicode decomposition would be nicer + char = chr(ord(char) - 0xff01 + 0x21) characters.append(char) last_kana = None