About ゆっくりTalk

Yukkuri Talk is the result of curiosity. Can you make an English-Japanese translation using shell commands? Yeah, you can, with curl/wget and cryptic sed commands. How do you push the resulting translation into a speech program? Yukkuri talk covers all this.

The program relies on a few main programs:

And the shell code that does most of the work:

curl -s -A '$useragent' -e 'http://www.excite.co.jp/world/english/' -d 'before=$urltxt&wb_lp=ENJA&start=+翻+訳+' http://www.excite.co.jp/world/english/ | grep id=.after | sed -e 's/^.*\">//' -e 's/<.*//'

Three commands are initially run in the shell, in order to get just the translation.

Next is the actual wav generation.

echo $yukkurisjis | kakasi -JH | $yukkuribin > $wavdir/$wavfilename.wav

Example flow

What happens to the text you send off

Action Text value
Submit "I'm charging my laser." I%27m+charging+my+laser.
curl gobs of HTML
grep <textarea cols=36 rows=15 name="after" id="after" wrap="virtual" style="width:320px;height:270px;" onselect="insertDictionaryKeyword(this);">私はレーザを請求しています。</textarea>
sed 私はレーザを請求しています。
kakasi わたしはレーザをせいきゅうしています。
yukkuri bin > wav WAV FILE, \(^o^)/

However, as with all machine translations, the result is never guaranteed accurate. Additionally, kakasi may not always choose the correct reading of a kanji.

PHP source is here.

Support/Questions here.