Closed sharathvignesh closed 6 years ago
Kanji only has a reading depending on its context, or rather, which word that kanji is being used in. Wanakana doesn't analyse the semantic content (the meaning) of the input you provide, it only transliterates. It's a complex job to determine which romaji a kanji character should translate to - it's a one-to-many relationship (人 = ひと, にん, じん, -り, -と + jukujikun readings like 大人 = おとな), whereas kana & romaji is one-to-one (ふ = フ = fu).
You can try Kuroshiro which uses Wanakana along with Kuromoji. However, you won't achieve 100% accuracy. For example, 一人 will commonly be presented as いちにん even in a situation where it most likely represents ひとり.
Thank you @DJTB. Your'e right, it is a complex job to determine which romaji a kanji character should translate to as they have one-to-many relationship.
Thank you for your quick response, I'll try Kuroshiro. 😄
@sharathvignesh No problem, best of luck!
Here's a fun one with 5 different readings of 日 to think about: "3月1日は日曜日で祝日、晴れの日でした"
I found Mecab which was good too. It converts them to Katakana, from which I was able to convert it to romaji using WanaKana's toRomaji.
The JS version of Ve only connects by http to the ruby version if I'm reading it correctly. It's not usable without that ruby server running I think. mecab executes an executable, so also not usable in a pure-js environment.
I was using
toRomaji
API to convert characters to Romaji. While Hiragana and katakana were successfully converted, I found that the kanji characters did not get converted to Romaji. Is there any way to get around this ?