Ubuntu – Offline dictionary with pronunciation and usages

dictionarysoftware-recommendation

Which is the best offline dictionary for Ubuntu ?

It should be like Cambridge or Oxford dictionaries with pronunciation.

The dictionaries, I found did not have enough examples of the sentence in use nor do they
tell a lot about meaning.

Best Answer

(I). dict - a CLI client to dictd server (offline usage):

Section - text

Installation:

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"

(to allow Universe repo)

sudo apt-get install dict
sudo apt-get install dictd

Installing English dictionary databeses (gcide, wn, devil):

sudo apt-get install dict-gcide
sudo apt-get install dict-wn
sudo apt-get install dict-devil

Installing English Thesaurus database (moby-thesaurus):

sudo apt-get install dict-moby-thesaurus

It also supports various translation/bilingual dictionaries.

Usage:

  1. Using a particular database (eg. WordNet - wn):

    dict -d wn "dictionary"
    
  2. Not specifying a dict-database will output definitions/translations/thesaurus from all available databases. eg.

    dict "dictionary"
    

    Workaround to include phoneme mnemonics:

    Let's define a function that will use espeak for phoneme mnemonics and dict for definitions, thesauri, and others.

    • First install espeak (if it's not already):

      sudo apt-get install espeak
      
    • Open the .bashrc file in your user-home directory with text editor of your choice:

      nano ~/.bashrc
      

      or

      gedit ~/.bashrc &
      

      (even better if you place your custom aliases and functions in ~/.bash_aliases rather than in ~/.bashrc)

    • Append the following function and save the file:

      function define {
      # espeak for the pronunciation audible output and phonetic alphabet string
      echo "Phoneme mnemonics: $(espeak -ven-uk-rp -x -s 120 "$1" 2> /dev/null)"       
      # dict - the client for the dictionary server
      dict "$1"       
      }
      

      [here I've used the switches -ven-uk-rp for British English Received Pronunciation (espeak --voices for more), -x to display mnemonics, -s for speech output speed. You can modify the switches for espeak or dict as per your needs.]

    • Open a new instance of terminal and use define to look for definitions. e.g.:

      define dictionary
      

      or

      define dictionary | less
      

      snap_hash (with less you can use arrow keys to scroll through the definitions; pressing h will show you some more controls that you can use; to quit press q)


(II). Gnome Dictionary:

Section - Universe/gnome

Installation:

sudo apt-get install gnome-dictionary

gnome-dictionary_snap

Note: To use gnome-dictionary offline, you should first install a dictionary server and the desired databases (the installation of dictd and some databases are shown in option (I) above.)

After installing gnome-dictionary, a dictionary server (e.g. dictd) and the databases (e.g. dict-wn, dict-gcide) you'll have to configure so that it looks up the locally installed server. To do this, start gnome-dictionary and from the menu navigate to Edit -> Preferences. In the Dictionary Preferences window, click Add button, then in Add Dictionary Source add the information about your local dictionary server; add the Description (like dictd), the Hostname - localhost (or some other in your local network), the Port number to 2628 (2628 is the default as specified in the DICT Protocol RFC.excerpt from dictd documentation) and hit the Add button. Then in Dictionary Preferences window, select dictd radio button and close the prefs window. Now you should be able to use it offline.

configGnD4offline selectSourceDictd


(III). "Artha", A handy off-line thesaurus based on WordNet:

Section - Universe/utils

Installation:

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"

(to allow Universe repo)

sudo apt-get install artha

artha_snap

(IV). "GoldenDict", offering feature-rich dictionary lookup program using WebKit for an accurate articles' representation, complete with all formatting, colors, images and links.

Section - Universe/utils

Installation:

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"

(to allow Universe repo)

sudo apt-get install goldendict

goldendict_snap

Related Question