Monday, May 1

Russian to English dictionaries on Linux

Update (2008-09-13): the dictionaries in http://dictd.xdsl.by/dicts are probably more complete than the ones provided here, see this post for more information.

It is very convenient for me to have a local dictd server set up, not only to look up obscure English words and jargon, but also for translation from foreign languages. Dictd is quite fast and powerful, with a multitude of dict clients to choose from. There are some pretty good free dictionaries too. For German, the dictionary in the Debian (Ubuntu) package dict-de-en (German-English + English-German) is fairly good. For Russian, the Mueller English-Russian dictionary (mueller7accent-dict) is great.

Unfortunately, the Mueller dictionary does not contain translations from Russian to English. I have been using ksocrat for that purpose, but KSocrat is a little buggy and its usability does not shine. I looked around on the web for a downloadable Russian-English dictionary in dict format, but surprisingly could not find anything useful. There are quite a few online translation sites, heaps of small DOS-era utilities and some home-made Windows stuff, but nothing that would be easy to feed to dictd. What I did find was Sdictionary.

Sdictionary is a dictionary application that has a fairly large community. Its Russian-English dictionary with 300 000 words was more than adequate for my purposes, but the database format was incompatible with dictd, and I couldn't find a converter on the web, so I wrote one.

The converter from Sdictionary to Dictd formats is a bash script that dumps an Sdictionary file to a plain text file and massages it a bit so that it can be fed to dictfmt. To use the script you will need to install PTkSdict from swaj.net (Debian package) and the Ubuntu packages dictfmt and dictzip. Then just drop the script in the same directory as some dictionary foo.dct and run ./sdict2dictd.sh foo (where foo is the name of the dct file). The script should produce foo.dict.gz and foo.index which you can install into /usr/share/dictd. The script is far from perfect and discards some formatting but it's better than nothing. The best solution would probably be to extend dictfmt so that it could read the Sdict dump files directly.

If you just want a dictd Russian-English dictionary, I have uploaded the files converted from Sdict here: rus_eng_full.dict.dz (8MB), rus_eng_full.index (15MB).

By the way, when running in daemon mode, dictd eats an unreasonable amount of RAM (it's taking 40MB resident memory on my machine). If the dict server is only for personal use, it makes sense to run it through inetd as described in /usr/share/doc/dictd/README.inetd.gz. It appears that the speed difference is not noticeable on modern computers.

11 comments:

Anonymous said...

My sincere thanks, this dictionary is very useful! I've been looking for a russian-english dict for Debian quite some time now. Ksocrat is not a perfect solution, as you pointed out.

Any idea if it could be added into Debian distribution? The sdict.com site has only this to say about copyrights (which doesn't make me very hopeful):

NOTE! All dictionary databases are taken from the internet, other open sources or were sent by independent authors. I really cannot track all copyright issues. If some databases have any copyrights, please immediately contact me!!

Simon said...

I found this dictionary really useful. I've never used dictd before so it too me a while to work out that as well as putting the files in /usr/share/dictd you need to edit the database section of the dictd.conf file.

In my case this said the dictionaries were defined in /var/lib/dictd/db.list and I just edited that file to include the new dictionary following the same pattern as the existing ones.

Then restart dictd if you have it running as a daemon ( or send it the HUP signal?)

Thanks again.

Tim said...

This might be a dumb question:

I seem to have installed everything fine, but being a newbie - how do I actually access the dictionary and make queries?

Thanks,
Tim

Gintautas Miliauskas said...

Use a standard dict client, such as gnome-dictionary, or kdict, or just "dict" (the command-line client).

Tim said...

Do you mean "Dictionary" in "Accessories" menu (in Ubuntu)?

It looks like you have to add a server.

Gintautas Miliauskas said...

Sure, you can use the standard GNOME dictionary application. If you installed the dictionaries properly, you already have a running dict server, so just use the "localhost" for the server address.

Tim said...

Maybe the dictionary didn't install properly. It seems that I can only run dict from the CL.

Even then, I only have he "Free Dictionary Russian" available (only English to Russian.)

I'll have to think again.

Anonymous said...

Thanks you ever so much! I've been using this dictionary with dictem in emacs for half a year now, it's fantastic!

Greetings,

David

Shade said...

I am immensely grateful! Very good job!!!

KKN Kel. Gebang said...

hello, I really interested to download it. but when I follow the link it ask me to login. it's not website login but kind of port login. please provide a valid link if you don't mind

caiyan said...

cheap nfl jerseys wholesale
true religion jeans
michael kors outlet
oakley sunglasses
beats by dre
michael kors outlet online
cheap ray ban sunglasses
coach outlet
coach outlet
ray ban sunglasses
0510shizhong