ikegami-yukino/jaconv

kana2alphabet bug っ(xtsu)

nemu626 opened this issue · 0 comments

I found a bug in your code when I tried to convert a sentence that ends with 'っ' . (example : 'あっ' , 'ぐっ')
IMO, Cause is clear, list variable 'text' must be cast to str

In [2]: jaconv.kana2alphabet('あっ')


TypeError Traceback (most recent call last)
in ()
----> 1 jaconv.kana2alphabet('あっ')

C:\ProgramData\Anaconda3\lib\site-packages\jaconv\jaconv.py in kana2alphabet(text)
211 tsu_pos = text.index('っ')
212 if len(text) <= tsu_pos + 1:
--> 213 return text[:-1] + 'xtsu'
214 text[tsu_pos] = text[tsu_pos + 1]
215 text = ''.join(text)

TypeError: can only concatenate list (not "str") to list