projects
/
zzz-pokedex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d1aa477
)
roomaji.py now handles "wu xe" and "shi xi" correctly. #132
author
Eevee
<git@veekun.com>
Fri, 16 Apr 2010 03:05:31 +0000
(20:05 -0700)
committer
Eevee
<git@veekun.com>
Sat, 17 Apr 2010 06:09:33 +0000
(23:09 -0700)
pokedex/roomaji.py
patch
|
blob
|
history
pokedex/tests/test_roomaji.py
patch
|
blob
|
history
diff --git
a/pokedex/roomaji.py
b/pokedex/roomaji.py
index
cdf30b5
..
95d559a
100644
(file)
--- a/
pokedex/roomaji.py
+++ b/
pokedex/roomaji.py
@@
-55,12
+55,21
@@
_roomaji_small_kana = {
u'ァ': 'a', u'ィ': 'i', u'ゥ': 'u', u'ェ': 'e', u'ォ': 'o',
}
_roomaji_small_kana_combos = {
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',
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):
}
def romanize(string):
diff --git
a/pokedex/tests/test_roomaji.py
b/pokedex/tests/test_roomaji.py
index
07a6aa7
..
09dfe71
100644
(file)
--- a/
pokedex/tests/test_roomaji.py
+++ b/
pokedex/tests/test_roomaji.py
@@
-17,10
+17,12
@@
def test_roomaji():
(u'ニャース', 'nyaasu'),
(u'ジャ', 'ja'),
(u'ぎゃくてん', 'gyakuten'),
(u'ニャース', 'nyaasu'),
(u'ジャ', 'ja'),
(u'ぎゃくてん', 'gyakuten'),
+ (u'ウェザーボール', 'wezaabooru'),
# Special katakana combinations
(u'ラティアス', 'ratiasu'),
(u'ウィー', 'wii'),
# Special katakana combinations
(u'ラティアス', 'ratiasu'),
(u'ウィー', 'wii'),
+ (u'セレビィ', 'sereby'),
]
for kana, roomaji in tests:
]
for kana, roomaji in tests: