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

Katakana ァ left unchanged by fromKana #24

Open
ghost opened this issue Jun 5, 2021 · 4 comments
Open

Katakana ァ left unchanged by fromKana #24

ghost opened this issue Jun 5, 2021 · 4 comments
Labels

Comments

@ghost
Copy link

ghost commented Jun 5, 2021

Thanks for this library! I'm using it to make a little game to help practice japanese reading. I found an edge case where it doesn't completely romanize a word:

hepburn.fromKana("スナバァ") == "SUNABAァ"

This is the Japanese name of the Pokémon Sandygast. I'm not sure what the correct behavior is there; Bulbapedia gives the romanized form as just "Sunaba".

@lovell
Copy link
Owner

lovell commented Jun 12, 2021

I believe the is a combining form of the letter A, so in this case the output should probably be SUNABĀ or SUNABAA rather than SUNABA.

https://en.wiktionary.org/wiki/%E3%82%A1

I found another example of this: ミネルウァ currently produces MINERUUァ but should probably be MINERUUA.

Happy to accept a PR that corrects this.

@lovell lovell added the bug label Jun 12, 2021
@risseraka
Copy link
Collaborator

I've taken a crack at this, well, it goes deeper!

Indeed, after a quick Web search, it seems that writing can be written as ラィティング instead of ライティング, the library output is then RAィTINGU.

It would need further research, but it might be safe to think that all vowel yōon katakanas (ァィゥェォ) can also be used as either a chōonpu, doubling the vowels, or as a standalone vowel in itself.

The easiest fix would be to list every combinations in katakanaDigraphs (hepburn.js, line 56), but that would not be the most elegant of solutions as it would multiple the diagram list by five.

I'll try coming up with something.
Do not hesitate to correct me if you find further evidence.

Cheers,

@lovell
Copy link
Owner

lovell commented Jun 16, 2021

@risseraka Arigato / merci beaucoup for investigating this, treating these vowel kana as choonpu feels like the right sort of approach.

@dustinlacewell
Copy link

I'm running into 彼はあなたの顔が好きです。 being converted to 彼HAANATANO顔GA好KIDESU。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants