![]() |
|
Batch translating list of words? - Printable Version +- kanji koohii FORUM (http://forum.koohii.com) +-- Forum: Learning Japanese (http://forum.koohii.com/forum-4.html) +--- Forum: Learning resources (http://forum.koohii.com/forum-9.html) +--- Thread: Batch translating list of words? (/thread-11418.html) |
Batch translating list of words? - vebaev - 2013-12-25 Hi, Do you know a method for translating a list of words, for example if I have 300 vocab words, i tried google translator but it is quite buggy? Batch translating list of words? - howtwosavealif3 - 2013-12-25 http://www.csse.monash.edu.au/~jwb/cgi-bin/wwwjdic.cgi?9T THIS SITE. i remember using it when i first srated learning japanese. Batch translating list of words? - vebaev - 2013-12-25 Great, thanks It does not give the reading, but anyway it is something better than nothing
Batch translating list of words? - howtwosavealif3 - 2013-12-25 it does. look closely. i remember copy pasting song lyrics, websites etc. Batch translating list of words? - cb4960 - 2013-12-26 Epwing2Anki might be what you are looking for. Batch translating list of words? - lauri_ranta - 2013-12-28 If you use OS X or Linux, you can add one word per line in ~/Desktop/words.txt and run a command like this in a terminal: curl ringtail.its.monash.edu.au/pub/nihongo/edict.gz|gzip -d|iconv -f euc-jp -t utf-8 >~/Desktop/edict;for word in $(<~/Desktop/words.txt);do grep "^$word " ~/Desktop/edict;done Batch translating list of words? - jmignot - 2013-12-29 lauri_ranta Wrote:If you use OS X or Linux, you can add one word per line in ~/Desktop/words.txt and run a command like this in a terminal:I tried but it returned an error in OSX: curl ringtail.its.monash.edu.au/pub/nihongo/edict.gz|gzip -d|iconv -f euc-jp -t utf-8 >~/Desktop/edict;for word in $(<~/Desktop/words.txt);do grep "^$word " ~/Desktop/edict;done Illegal variable name. Is there a typo in this command (copy-pasted from your post)? Batch translating list of words? - gaiaslastlaugh - 2013-12-29 If you have an iPhone, Midori does a decent job of this. Batch translating list of words? - lauri_ranta - 2013-12-29 jmignot Wrote:I tried but it returned an error in OSXThe command worked for me when I copied and pasted it from the post. If your shell is csh, try using bash instead. csh can be the default shell if you have a really old version of OS X or if you have upgraded from an old version of OS X. Here's a Ruby script that should also work out of the box in (relatively new versions of) OS X: edict = {} IO.read("JMdict_e").scan(/<entry>.*?<\/entry>/m).each { |entry| keb = entry[/(?<=<keb>).*(?=<\/keb>)/] || next reb = entry[/(?<=<reb>).*(?=<\/reb>)/] next if edict[keb] gloss = entry[/(?<=<gloss>).*(?=<\/gloss>)/] gloss = gloss.sub(/^(\([^)]+\) )*/, "").sub(/ \([^)]+\)$/, "") edict[keb] = [reb, gloss] } IO.read("words.txt").split.each { |word| reb, gloss = edict[word] || next puts word + "\t" + reb + "\t" + gloss } You can run the script by for example saving it as jmdict.rb in the home folder, putting http://ringtail.its.monash.edu.au/pub/nihongo/JMdict_e and words.txt in the home folder, and then running "ruby jmdict.rb" in Terminal. Batch translating list of words? - vebaev - 2014-01-08 lauri_ranta Wrote:If you use OS X or Linux, you can add one word per line in ~/Desktop/words.txt and run a command like this in a terminal:Thanks that worked for me like a charm! Batch translating list of words? - jmignot - 2014-01-24 lauri_ranta Wrote:This was the right answer.jmignot Wrote:I tried but it returned an error in OSXThe command worked for me when I copied and pasted it from the post. If your shell is csh, try using bash instead. csh can be the default shell if you have a really old version of OS X or if you have upgraded from an old version of OS X. I am still using csh (or tsch) on my Mac. Switched to bash and problem was solved! Thanks. |