Allow small ッ before a vowel

This is a nonstandard use of ッ and it doesn't really have a defined
romanization, but we need to support it for Cramorant (ウッウ, U'u).
This commit is contained in:
Andrew Ekstedt 2021-03-07 11:16:57 -08:00
parent b09929dfb6
commit a91a7d95b3
2 changed files with 5 additions and 3 deletions

View File

@ -98,9 +98,9 @@ class Romanizer(object):
if last_kana == 'sokuon':
if kana[0] in vowels:
raise ValueError("Sokuon cannot precede a vowel.")
characters.append(kana[0])
characters.append("'")
else:
characters.append(kana[0])
elif last_kana == 'n' and kana[0] in vowels:
characters.append("'")

View File

@ -25,6 +25,7 @@ import pokedex.roomaji
(u'ラティアス', 'ratiasu'),
(u'ウィー', 'wii'),
(u'セレビィ', 'sereby'),
(u'ウッウ', u"u'u"),
]
)
def test_roomaji(kana, roomaji):
@ -52,6 +53,7 @@ def test_roomaji(kana, roomaji):
(u'ラティアス', u'ratiasu'),
(u'ウィー', u''),
(u'セレビィ', u'serebí'),
(u'ウッウ', u"u'u"),
]
)
def test_roomaji_cs(kana, roomaji):