1

I am using string tokenizer and transform APIs to convert kanji characters to hiragana. The code in query (What is the replacement for Language Analysis framework's Morpheme analysis deprecated APIs) converts most of kanji characters to hiragana but these APIs fails to convert kanji word having 3-4 characters. like-

a) 現人神 is converted to latin - 'gen ren shen' and in hiragana- 'げんじんしん' whereas it should be - in latin - 'Arahitogami ' and in hiragana- 'あらひとがみ'

b) 安本丹 is converted to latin - 'an ben dan' and in hiragana- 'やすもとまこと' whereas it should be - in latin as - 'Yasumoto makoto ' and in hiragana- 'あんぽんたん'

My main purpose is to obtain the ruby text for given japanese text. I cant use lang analysis framework as its unavailable in 64-bit.

Any suggestions? Are there other APIs to perform such string conversion?

Community
  • 1
  • 1
Nitesh
  • 2,681
  • 4
  • 27
  • 45

1 Answers1

0

So in both cases your API uses onyomi but shouldn't. So I assume it just guesses "3 or more characters ? onyomi should be more appropriate in most cases, so I use it". Sounds like an actual dictionary is needed for your problem, which you can download.

Names ( for b) ) should still be a problem tho. I don't see how a computer should be able to get the correct name from kanjis, as even native japanese people sometimes fail at it. jisho.org doesn't even find a single name for 安本丹.

( Btw you mixed up your hiragana in b), and the latin for 'あんぽんたん'. I can't write comments yet with my rep so I'm leaving this here )

Slyps
  • 607
  • 4
  • 9
  • The link provided is of an online dictionary whereas I want to do that in a Cocoa application. I think I am better off using Kakasi library. I wanted to know if there are OSX supported APIs for doing that in 64-bit, as these are available in 32-bit through lang analysis framework. – Nitesh Jul 17 '14 at 05:31
  • The link provided is of an online dictionary providing links to other sites to download database files. Nobody answered your question and you asked for other "APIs", and with the databases you can do that yourself, incase you don't find other working existing APIs ... – Slyps Jul 17 '14 at 08:28
  • This page (written in Japanese) says it's possible to install Kakashi into OS X Mavericks. http://qiita.com/mountcedar/items/f140837393a1697a8433 . This article also mentions that you need `nkf`, the Network Kanj Filter, in order to convert character set from UTF-8 into euc-jp, because Kakashi accepts only euc-jp as an input string. – naota Jul 18 '14 at 11:03