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

to_kana() doesn't consistently return Hepburn or Kunrei #8

Open
blagarde opened this issue Jan 23, 2014 · 1 comment
Open

to_kana() doesn't consistently return Hepburn or Kunrei #8

blagarde opened this issue Jan 23, 2014 · 1 comment

Comments

@blagarde
Copy link

Hello,

I have already reported a couple of other issues and a PR, but I haven't yet even taken the time to thank you for this neat package... Thank you!!

I am opening this issue because I am a bit confused with which inverse romanization I should expect to_kana(str) to return.

These lines suggest that your intent was for it to return the Hepburn version if possible, otherwise the Kunrei version:
https://github.com/soimort/python-romkan/blob/master/src/romkan/common.py#L373-376

Later however, ROMKAN.update( {"ti": "チ"} ) explicitly prescribes Kunrei over Hepburn:
https://github.com/soimort/python-romkan/blob/master/src/romkan/common.py#L382-383
( "チ" is Kunrei, "ティ" is Hepburn)

What is the rationale behind this?
Is the intent to emulate keyboard input method ("wapuro" style) inverse romanization?

Thanks!
Baptiste

@soimort
Copy link
Owner

soimort commented Jan 23, 2014

Good question. The code is ported from the original Romkan and I did not change it since then. When converting romaji to kana, ti could be any of these

>>> romkan.to_kana('ti')
'チ'
>>> romkan.to_kana('ti')
'ティ'

(same problem with di, du...)

Obviously we should have two methods for doing this, to_kana_from_kunrei and to_kana_from_hepburn, to avoid any confusion. Furthermore, it should be specified in the document that to_kana prescribes Kunrei over Hepburn.

I'll fix this issue later, when I have more free time to dive into the code (hopefully in one or two weeks). Also I will take a look at other issues you reported then.

Thank you for your interest! This really helped a lot.

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