Programs that convert Kanji+Kana to Romaji

Started by 100C · 18 Apr 2004 · 23 replies

Learn Japanese Page 1 of 2

18 Apr 2004, 15:25 #1
Probably, you want to translate English into Japanese with machine translation service or translation software. However, they are outputted in Kanji+Kana sentence. In order to know how it should be pronounced, you have to consult a dictionary repeatedly.

But, I found there are application programs which automates it.
One of them is a browser of shareware. The another is free software which needs a little knowledge of DOS usage.


1.Browser
HIRAGANA Navi.V3 http://kids.knowledgewing.com/

Originally, it is developed for the schoolchild who is learning Kanji, and has the function to change Kanji into Kana. Moreover, there is also a function changed into Roman alphabet.
Operation is easy, but required to pay 4,000 yen for using it exceeding the trial period for 20 days.


2.Free tool
KAKASI - Kanji Kana Simple Inverter http://kakasi.namazu.org/index.html.en

KAKASI is the language processing filter to convert Kanji characters to Hiragana, Katakana or Romaji and may be helpful to read Japanese documents.

You use it in command-prompt (DOS Window).
ex.
c:\kakasi\bin>kakasi -s -U -Ja -Ha -Ka < kanji.txt > romaji.txt

Input(kanji.txt):
KAKASI‚ÍŠ¿Žš‚©‚ȍ¬‚¶‚è•¶‚ð‚Ђ炪‚Ȃ⃍[ƒ}Žš‚ɕϊ·‚·‚邱‚Æ‚ð–Ú“I‚Æ‚µ‚Ä

Output(romaji.txt):
KAKASI ha KANJI kana MAJI ri BUN wohiraganaya ro^ma JI ni HENKAN surukotowo MOKUTEKI toshite
19 Apr 2004, 15:53 #2
oh this is great. thanks!
1 May 2004, 22:40 #3
Thanks! I new about Kakasi, but never I managed to make it work with all those parameters. Now I can. :)
For those looking for a more direct link to download Hiragana Navy: http://kids.knowledgewing.com/share/share1.html
2 May 2004, 14:24 #4
u r welcome.
and there is also web version of it.(it can convert text and webpage)

http://www.j-talk.com/nihongo/

EKanji to spaced Hiragana
EReadings in brackets
EKanji to Romaji
EDetailed word info(not websites)
EKanji with rollover Hiragana, and translation in pop up!
3 May 2004, 01:18 #5
I also had those software that looks like kakasi (command-line and free with source code). Never managed to make them work very well unless it's a text file.
Juman 4.0
ComCha
Chasen
18 Jun 2004, 01:55 #6
i know kanji has different readings, especially the individual kanji characters when used with others for forming other words, they will have different readings, also in different contexts, they will have a different reading.. can these programs decipher?
20 Jun 2004, 02:29 #7
They can if you use the "all" parameter. But, you still need to choose manually the one you want to keep. :( It's a lot of work if you are not fluent in japanese.
27 Nov 2004, 16:23 #8
How do I set up Kakasi? When I download the package there isn't any sort of a setup or installation program, and I don't know what to do...
4 Dec 2004, 05:10 #9
There is no install. Just extract it to C:\Kakasi\ .It's the default path. To run it, you need to launch the application in c:\kakasi\bin\ using a command window.
You can also create a text file in c:\kakasi\bin, copy this text:
kakasi -s -U -Ja -Ha -Ka<kanji.txt> romaji.txt
and save the file as a .bat instead of .txt.
So, you just need to double-click the .bat file, instead of typing the big command line all the time. :)

I'm not sure if I'm clear enough...

:say_gdluck:
7 Dec 2004, 19:01 #10
I have visited many sites for the exe of Kakasi. But I didn't get it. Also when I extracted the source file, there is no bin folder is created. So can you send me the bin folder so that I can check Kakasi. Also I could not create the exe from the source files. It is not compiling successfully.

Also can You tell me about the configurations of kakasi so that I can run the source file extracted.

Heard that Kakasi itself tokenizing the kanji before it is translated in to romaji. Can you explain about it ?

Is there any APIs available for Kakasi ? also the exe of Kakasi is very urent. Can you send the exe or can you say the path. I am using windows OS and the binary files are not available in http://kakasi.namazu.org/ for windows

Also is there any programs for the conversion of hiragana and katakana to romaji ?

Thanks in Advance

Sunil
8 Dec 2004, 03:12 #11
sunilkkn wrote:I have visited many sites for the exe of Kakasi. But I didn't get it. Also when I extracted the source file, there is no bin folder is created. So can you send me the bin folder so that I can check Kakasi. Also I could not create the exe from the source files. It is not compiling successfully.

Dude, you've got to put a little more effort into it...

http://www.namazu.org/win32/kakasi-2.3.4.zip

As for an API... There is a perl API being designed here:

http://search.cpan.org/dist/Text-Kakasi/

You can then use the perl API as a CGI, then use a web page as the user interface.

I'm going a similar route... I'm writing a BBcode MOD for phpBB (JDorama.com and d-addicts.com uses phpBB) to utilize kakasi. It can then be used by anyone in a posting. It'll look something like this in the phpBB editor:

[code:1]This is a test&#58;

&#91;kakasi&#93;KAKASI ‚́AŠ¿Žš‚©‚Ȃ܂¶‚è•¶‚ð‚Ђ炪‚È•¶‚⃍&#91;ƒ&#125;Žš•¶‚ɕϊ·‚·‚邱‚Æ‚ð–Ú“I‚Æ‚µ‚č쐬‚µ‚½ƒvƒƒOƒ‰ƒ€‚ÆŽ«‘‚Ì‘Ì‚Å‚·B&#91;/kakasi&#93;[/code:1]


--- groink
8 Dec 2004, 15:04 #12
Thanx groink. I got the executable of kakasi and it is running. Also the zip includes the libraries.

Kakasi is fine. i hope, I can use it for my requirement. My requirements are to convert kanji, kana to romaji and tokenizing the japanese string.

When I visited the url http://kakasi.namazu.org/, I got the source code of kakasi in C language. And in that source code, I found many main method.

For running Kakasi, whether we need only kakasi.c and kakasi.h ? I am asking about c, because I don't know perl. Do you know, how to make executable of kakasi from the c program ?

Thanx for the executable of kakasi.

Sunil
8 Dec 2004, 18:16 #13
Hi,

I have run the executable of kakasi as follows :

kakasi -s -U -Ja -Ha -Ka <kanji.txt> romaji.txt

and the kanji.txt contains “úŒÄ‚Ñ.

Its translation in romaji must be nichiyobi. but the text file romaji.txt contains the data

RU SUI&#8212;yueJAKU&#129;.

And for all translation, the romaji.txt contains RU SUI as the first characters. Anybody can explain why this hapens ?

Actually my requirement is to convert kanji characters and kana characters to romaji characters. Could you pls say the options that I need to add with kakasi.exe for this ?

sorry guys.. Actually I am not a japanese language expert. But this is for my project in which I need to translate the japanese text (in Kanji, hiragana and in katakana) to romaji. First time I execute the kakasi and got one output in the romaji.txt. I thought the output is correct. But my colleague, he knows japanese, told me that it is wrongly translated. This is only a sample text that I was tested.

So please help me

Thanks

Sunil
9 Dec 2004, 00:23 #14
I am not familiar with program language. I had used google and found Kakasi. so, I could not explain these in detail.

U SUI&#8212;yueJAKU&#65533;.


You may used Kanji code "UTF-8".
kakasi only supports with old JIS, new JIS, EUC, DEC, SHIFTJIS.
Not Unicode(like UTF-8 UTF-8N UTF-16....etc).
So you have to make input text file wiih these supported Kanji code.


and

Microsoft Agent http://www.microsoft.com/msagent/downloads/user.asp and Third-party's Reading up software.
Your PC speak Japanese. (need Japanese engine)
9 Dec 2004, 03:40 #15
100C wrote:You may used Kanji code "UTF-8".
kakasi only supports with old JIS, new JIS, EUC, DEC, SHIFTJIS.
Not Unicode(like UTF-8 UTF-8N UTF-16....etc).
So you have to make input text file wiih these supported Kanji code.

That's exactly correct. Some text editors, especially notepad.exe, saves as UTF-8.

Also, if you download web pages to text files, make sure that the encoding method used to render these pages are Shift-JIS or similar. For Internet Explorer users, you can force this encoding mode on a particular page by selecting View -> Encoding -> Japanese (Shift-JIS). Then, once the page is re-rendered, you can save the page as a text file.

--- groink
9 Dec 2004, 10:47 #16
You can get a free Japanese Word Processor (JWPce) at http://www.physics.ucla.edu/~grosenth/c_download.html
I tried “úŒÄ‚Ñ, save it to Shift-JIS and kakasi converted it to: NICHI YOBI.
So, I guess it worked :)
By typing kakasi -h, you can get all the options.
9 Dec 2004, 22:09 #17
Yes. Thanx for your comments. Actually I have done the same. I saved the file kanji.txt with utf-8 format. that was why I got wrong answer. Thank you for your comments. Now I tested all the kanji texts with the kakasi front end and got the correct answer. Anybody know how to make the API (c and header files) runnable ?

For my project, I need to tokenize the japanese text which contains kanji, kana. Is there any method available for it ? I have browsed for the tokenizer. But failed to find a gud tokenizer. Anybody can help me ?

Once again thanx for your help...

Sunil
10 Dec 2004, 04:14 #18
sunilkkn wrote:Yes. Thanx for your comments. Actually I have done the same. I saved the file kanji.txt with utf-8 format. that was why I got wrong answer. Thank you for your comments. Now I tested all the kanji texts with the kakasi front end and got the correct answer. Anybody know how to make the API (c and header files) runnable ?

I'd first off study the perl interface I posted earlier. See how that interface communicates with kakasi, then possibly reverse engineer the code and re-work it in C++. My C++ is pretty weak seeing I haven't worked with that language in eons, so I can't help you there.

--- groink
14 Dec 2004, 14:27 #19
Hi,

I got Juman 4.0 for tokenizing the japanese text. Both executable and source code. But the documentaion about how to run is not so understandable. When I execute the application, the following out put occurring.

C:\Program Files\juman>juman -b -e -r kanji.jumanrc
¿&#9559;„¢ƒ³&„ ƒÐ&&ƒ³&&ƒÎ&&ƒ¦&&ƒÐ&&#8359;
is not list. in <car>

parse error between line 819 and 819.
exit(5)

and the kanji.jumanrc contains the following text

”]“®–¬‚̕Ç

I can't find why this happens ?

Pls help me. anybody know the way to run juman.exe ?

Thanks & Regards

Sunil
15 Dec 2004, 01:26 #20
I do not understand most meanings of the word "tokenizer." However, I can read Japanese.
(It is hard to read English for me.)

Juman reads from Standard-In and outputs to Standard-Out.
It understands only SJIS among some kanji codes.
Therefore, when it was operated as follows, it operated normally.

[code:1]C&#58;\Program Files\juman>juman -b
&#33075;&#21205;&#33032;&#12398;&#38281;&#22622;
&#33075; &#40;&#12398;&#12358;&#41; &#33075; &#26222;&#36890;&#21517;&#35422;
&#21205;&#33032; &#40;&#12393;&#12358;&#12415;&#12419;&#12367;&#41; &#21205;&#33032; &#26222;&#36890;&#21517;&#35422;
&#12398; &#40;&#12398;&#41; &#12398; &#25509;&#32154;&#21161;&#35422;
&#38281;&#22622; &#40;&#12408;&#12356;&#12381;&#12367;&#41; &#38281;&#22622; &#12469;&#22793;&#21517;&#35422;
EOS
^Z

C&#58;\Program Files\juman>juman -b < input.txt
&#33075; &#40;&#12398;&#12358;&#41; &#33075; &#26222;&#36890;&#21517;&#35422;
&#21205;&#33032; &#40;&#12393;&#12358;&#12415;&#12419;&#12367;&#41; &#21205;&#33032; &#26222;&#36890;&#21517;&#35422;
&#12398; &#40;&#12398;&#41; &#12398; &#25509;&#32154;&#21161;&#35422;
&#38281;&#22622; &#40;&#12408;&#12356;&#12381;&#12367;&#41; &#38281;&#22622; &#12469;&#22793;&#21517;&#35422;
EOS

C&#58;\Program Files\juman>juman -b < input.txt > output.txt

C&#58;\Program Files\juman>type output.txt
&#33075; &#40;&#12398;&#12358;&#41; &#33075; &#26222;&#36890;&#21517;&#35422;
&#21205;&#33032; &#40;&#12393;&#12358;&#12415;&#12419;&#12367;&#41; &#21205;&#33032; &#26222;&#36890;&#21517;&#35422;
&#12398; &#40;&#12398;&#41; &#12398; &#25509;&#32154;&#21161;&#35422;
&#38281;&#22622; &#40;&#12408;&#12356;&#12381;&#12367;&#41; &#38281;&#22622; &#12469;&#22793;&#21517;&#35422;
EOS

C&#58;\Program Files\juman>
[/code:1]

Replying needs an account. Registration opens soon.