hepburn icon indicating copy to clipboard operation
hepburn copied to clipboard

Katakana ァ left unchanged by fromKana

Open ghost opened this issue 3 years ago • 4 comments

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".

ghost avatar Jun 05 '21 16:06 ghost

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 avatar Jun 12 '21 21:06 lovell

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,

risseraka avatar Jun 14 '21 07:06 risseraka

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

lovell avatar Jun 16 '21 17:06 lovell

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

dustinlacewell avatar Feb 23 '24 19:02 dustinlacewell