Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'ヸ' #26

Closed
mhagiwara opened this issue Sep 24, 2021 · 1 comment
Closed

KeyError: 'ヸ' #26

mhagiwara opened this issue Sep 24, 2021 · 1 comment

Comments

@mhagiwara
Copy link

katsu.romaji("秋の日のヸオロンのためいきの身にしみてひたぶるにうら悲し。")

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
/tmp/ipykernel_2037/678387450.py in <module>
----> 1 katsu.romaji("秋の日のヸオロンのためいきの身にしみてひたぶるにうら悲し。")

~/miniconda3/envs/janlpbook/lib/python3.7/site-packages/cutlet/cutlet.py in romaji(self, text, capitalize, title)
    143 
    144             # resolve split verbs / adjectives
--> 145             roma = self.romaji_word(word)
    146             if roma and out and out[-1] == 'っ':
    147                 out = out[:-1] + roma[0]

~/miniconda3/envs/janlpbook/lib/python3.7/site-packages/cutlet/cutlet.py in romaji_word(self, word)
    212             if word.char_type == 6 or word.char_type == 7: # hiragana/katakana
    213                 kana = jaconv.kata2hira(word.surface)
--> 214                 return self.map_kana(kana)
    215 
    216             # At this point this is an unknown word and not kana. Could be

~/miniconda3/envs/janlpbook/lib/python3.7/site-packages/cutlet/cutlet.py in map_kana(self, kana)
    252             nk = kana[ki + 1] if ki < len(kana) - 1 else None
    253             pk = kana[ki - 1] if ki > 0 else None
--> 254             out += self.get_single_mapping(pk, char, nk)
    255         return out
    256 

~/miniconda3/envs/janlpbook/lib/python3.7/site-packages/cutlet/cutlet.py in get_single_mapping(self, pk, kk, nk)
    285             else: return 'n'
    286 
--> 287         return self.table[kk]
    288 

KeyError: 'ヸ'

I think this is an old variant of "ヴィ".

Source: https://tatoeba.org/en/sentences/show/2478013

@polm polm closed this as completed in 262e92f Sep 25, 2021
@polm
Copy link
Owner

polm commented Sep 25, 2021

Thanks! Hadn't seen that one before.

This is fixed in master, I'll do a release soon.

@polm polm mentioned this issue Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants