Offline English and DRAE dictionaries for the terminal

I have wanted to post how to check words from the console for a long time, but Elav forward.

I briefly quote the phrase of Elav's English teacher who shared with us in her post […] When you don't know a word in English, look it up in an English dictionary, not in a translator […]

In this post we will use an application called sdcv, which is a command line interface to the popular (currently unsupported) StarDict application. Of course, those who so wish can install their respective graphical interface. In addition I have uploaded some dictionaries so that they do not take long to find them and can install them quickly.

What I like about this application is that it shows you the definitions of all the available dictionaries, so you can have the definition of several dictionaries and the equivalent word in other languages ​​or only in another, depending on how it is configured.

Dictionaries included:

English:

  • Oxford
  • WordNet

Spanish:

  • Dictionary of the Royal Spanish Academy (RAE)

Bilingual:

  • Spanish English
  • English Spanish
In this post we are also going to install the one suggested by Elav in the post I told you about, so be careful not to duplicate it.

Sdcv installation

Gentoo:

emerge sdcv
I didn't need to move him to the USEs and he was installed shortly. Of course, the issue of USEs is highly variable.

Slackware:

Slackbuild available, http://slackbuilds.org/repository/14.0/misc/sdcv/. I installed it successfully with sbopkg, I didn't need to look for additional dependencies.

Arch:

pacman -S sdcv

Ubuntu:

sudo apt-get install sdcv

For other distributions it is similar, for example in Fedora it would be yum install sdcv, in opensuse zypper in sdcvEtc. ...

Installing the dictionaries:

cd && wget https://dl.dropboxusercontent.com/u/70368222/dics.tar.gz
mkdir -p /usr/share/stardict/dic
cd /usr/share/stardict/dic
sudo tar -xvzf dics.tar.gz

Now they have these dictionaries installed.

Usage and syntax

The simplest way to use it is by typing sdcv and the words to query, for example:

sdcv hello world

Usage: sdcv [OPTIONS] words
-h, --help display this help and exit
-v, --version display version information and exit
-l, --list-dicts display list of available dictionaries and exit
-u, --use-dict bookname for search use only dictionary with this bookname
-n, --non-interactive for use in scripts
–Utf8-output output must be in utf8
–Utf8-input input of sdcv in utf8
–Data-dir path / to / dir use this directory as path to stardict data directory


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   3rn3st0 said

    Practical and simple. 100% implemented

    Thank you! (Y) 🙂

    1.    Angel_Le_Blanc said

      You're welcome

  2.   pavloco said

    Excellent, I was looking for something like that. Thank you.

    1.    Angel_Le_Blanc said

      You're welcome.

  3.   Angel_Le_Blanc said

    An important observation is that when I installed it in Gentoo I had not configured Gentoo to use UTF-8, accented words and the ñ accent did not recognize them. The UTF-8 parameters can be useful in those cases.

  4.   Byron said

    A greeting! I never miss an entry on your blog, really one of the best about Linux in Spanish that you can get on the net! An off-topic question (I do not mean by this that it is a bad input xD) what is the font you use? (the one seen in the title of the terminal) thank you! Congratulations from Venezuela!

    1.    Angel_Le_Blanc said

      Not that the blog belongs to someone, although of course they are Elav, gara_KZKG ... I think the blog belongs to everyone for everyone. Now, the image that this post represents was originally used by Elav, he would know how to answer what you ask.

      1.    wada said

        The capture is mine 😀 and the source is terminus is in aur (archlinux)

  5.   jon85p said

    Interesting, I'll try it.

  6.   Sergio said

    Well, I liked this post, an offline dictionary never hurts, and in the terminal it makes it a little more peculiar, very good contribution. Thank you.

  7.   dannlinx said

    Great totally practical and functional. Thanks a lot!!!

  8.   Carlos Rivera said

    Thank you, it helped me a lot. He was always looking for this, and in the terminal he does it better.

  9.   snack said

    Very good

  10.   dhunter said

    I made my own translator using the i2e db (it was in the Debian 4 repo I think).

    https://github.com/xr09/shakespeare/archive/0.7b1.tar.gz

    It has PyQt4 UI and cli with colors.

    Pictures ...
    http://imgur.com/ePqyjWq,4uGKNMD

  11.   Adrian said

    when in the terminal I put
    sudo tar -xvzf dics.tar.gz
    something like

    tar (child): dics.tar.gz.1: Cannot open: File or directory does not exist
    tar (child): Error is not recoverable: exiting now
    Tar: Child Returned Status 2
    Tar: ERROR IS NOT RECOVERABLE: EXITING NOW

    1.    Adrian said

      that I have to do

      1.    Angel_Le_Blanc said

        It means that either the file was not downloaded, or it was downloaded under another name.
        Why don't you make sure that dics.tar.gz downloaded you?
        Or try again?

        1.    Angel_Le_Blanc said

          Now that I see the second line, mkdir should be used as root. It is good to reflect on what each command does.

  12.   Ricardo said

    Excellent, you don't know how long this process had in the background, waiting for it to appear.

  13.   cookie said

    Excellent, much more comfortable than looking for the meaning on the web.
    Thank you!

  14.   Javier said

    I join the majority and I thank you for this fantastic post.
    However, after going through the steps a second time after a reinstallation of Debian Testing and Xfce, I have not gotten them to work. He only recognizes the Oxford, none of the others. Before the reinstallation everything worked perfectly, I even had some aliases configured to consult only the DRAE.
    In addition, I had to move dics.tar.gz to the stardict / dic directory to unzip, because with the commands in the guide it cannot find the file. But what annoys me is that the dictionaries are not there when I do sdcv -l, it only lists the Oxford.
    I have changed permissions to the files with chmod -R to + r / usr / share / stardict / dic / so that all users can read them, but nothing.
    Any ideas? Thank you very much in advance.

    1.    Javier said

      I answer to myself, in case it helps someone.
      Indeed, the problem was one of permissions, and the way to solve it, although unorthodox, was simple:
      I just opened the directory with Thunar as superuser and, checking the permissions of the folders, I noticed the message that says they are inconsistent. By clicking on the button that kindly suggests correcting the errors everything remains as it should.
      Best regards.

  15.   FP said

    Thank you for this very useful idea to have dictionaries at hand. This is helping.

  16.   Mario Guillemo Zavala Silva said

    I'm using Maya 13.00 and it tells me that I don't have sufficient administrative permissions, I need your help because what I have done is load an old dic with wine. of win Xp.

    Help me Please Greetings !!!!

  17.   x man said

    Impeccable, installed and running 100%.

    Kernel: 3.16.3-1.gd2bbe7f-desktop x86_64 (64 bit) Desktop: KDE 4.14.1
    Distro: openSUSE 13.1 (Bottle)

    Thanks for sharing. 😉

  18.   gloss said

    Thanks a lot! I've been looking for something like that for a long time. Linux and happy hugs!

  19.   linuXgirl said

    Excellent! I will try it. I'm very happy to have a good free dictionary, that's why… Wine, you can go to m…!

  20.   Daniel bathrobe said

    Very useful. Thank you!

  21.   Miguel said

    you have to update because I get the following:
    Connecting with dl.dropboxusercontent.com (dl.dropboxusercontent.com) [162.125.48.131]: 443… connected.
    HTTP request sent, waiting for response… 404 Not Found
    2017-04-18 14:13:24 ERROR 404: Not Found.
    It will be greatly appreciated if you update it or tell me what other medium I can use

  22.   Matthias of the Source said

    Thanks for the excellent tutorial!

    For those who get an error, I pass 2 Spanish-English and English-Spanish dictionaries for stardict that I found out there.

    https://www.dropbox.com/sh/hsh7vqsn6smhmo5/AADKlb4bCnoM8RZp-Z7Rf1owa?dl=0

    Regards!

  23.   Ezekiel said

    very useful! thanks for sharing and thanks also to Matías de la Fuente for the files

  24.   Al said

    Apparently time has changed the information and it has not been updated. Does it still work somehow? Thanks.

    :~# cd && wget https://dl.dropboxusercontent.com/u/70368222/dics.tar.gz
    –2022-11-24 05:36:46– https://dl.dropboxusercontent.com/u/70368222/dics.tar.gz
    Resolving dl.dropboxusercontent.com (dl.dropboxusercontent.com)… 2620:100:601d:15::a27d:50f, 162.125.5.15
    Connecting to dl.dropboxusercontent.com (dl.dropboxusercontent.com)[2620:100:601d:15::a27d:50f]:443… connected.
    HTTP request sent, waiting for response… 404 Not Found
    2022-11-24 05:36:47 ERROR 404: Not Found.