Back

Batch translating list of words?

#1
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?
Edited: 2013-12-25, 2:19 pm
Reply
#2
http://www.csse.monash.edu.au/~jwb/cgi-b...dic.cgi?9T
THIS SITE. i remember using it when i first srated learning japanese.
Edited: 2013-12-25, 2:41 pm
Reply
#3
Great, thanks
It does not give the reading, but anyway it is something better than nothing Smile
Reply
May 16 - 30 : Pretty Big Deal: Save 31% on all Premium Subscriptions! - Sign up here
JapanesePod101
#4
it does. look closely. i remember copy pasting song lyrics, websites etc.
Reply
#5
Epwing2Anki might be what you are looking for.
Reply
#6
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
Reply
#7
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:

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
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)?
Edited: 2013-12-29, 3:32 am
Reply
#8
If you have an iPhone, Midori does a decent job of this.
Reply
#9
jmignot Wrote:I tried but it returned an error in OSX
The 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.
Reply
#10
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:

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
Thanks that worked for me like a charm!
Reply
#11
lauri_ranta Wrote:
jmignot Wrote:I tried but it returned an error in OSX
The 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.
This was the right answer.
I am still using csh (or tsch) on my Mac.
Switched to bash and problem was solved!

Thanks.
Reply