polm / cutlet

Japanese to romaji converter in Python
https://polm.github.io/cutlet/
MIT License
286 stars 20 forks source link

KeyError: 'っ' #20

Closed meo-meo closed 3 years ago

meo-meo commented 3 years ago

Here is a new KeyError I got:

% cutlet
ずっーと
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "$HOME/anaconda3/envs/py36_mecab/lib/python3.6/site-packages/cutlet/cutlet.py", line 133, in romaji
    roma = self.romaji_word(word)
  File "$HOME/anaconda3/envs/py36_mecab/lib/python3.6/site-packages/cutlet/cutlet.py", line 228, in romaji_word
    return self.map_kana(kana)
  File "$HOME/anaconda3/envs/py36_mecab/lib/python3.6/site-packages/cutlet/cutlet.py", line 238, in map_kana
    out += self.get_single_mapping(pk, char, nk)
  File "$HOME/anaconda3/envs/py36_mecab/lib/python3.6/site-packages/cutlet/cutlet.py", line 254, in get_single_mapping
    if pk: return self.table[pk][-1]
KeyError: 'っ'
polm commented 3 years ago

Thanks for the report, that is not a case I had considered. I made an alpha release that should fix it, please give it a try and let me know if it works.

pip install cutlet==0.1.15a1
polm commented 3 years ago

Released 0.1.15, which resolves this.