Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any tools to programmatically convert Japanese sentence into its romaji (phonetical reading)? [closed]

Input:

日本が好きです.

Output:

Nippon ga sukidesu.

Phonetical reading is unfortunately not available through Google Translate API.

like image 681
Arman Avatar asked Apr 29 '11 03:04

Arman


1 Answers

KAKASI is a good, simple tool for what you want to do:

% echo "日本が好きです。" | iconv -f utf8 -t eucjp | kakasi -i euc -Ha -Ka -Ja -Ea -ka
nippongasukidesu.

% echo "日本が好きです。" | iconv -f utf8 -t eucjp | kakasi -i euc -w | kakasi -i euc -Ha -Ka -Ja -Ea -ka
nippon ga suki desu .

Or another solution is to use Yahoo! JAPAN's Japanese Language Processing API. But it might be difficult to use because you need to sign up for Yahoo! JAPAN and register for the API key before using it and the documents are only available in Japanese.

like image 188
yibe Avatar answered Dec 06 '22 21:12

yibe