Hindi Spell-check and Auto-suggest in Emacs

 


Spellcheck

Install aspell

sudo apt install aspell

Install Hindi dictionary for aspell from https://ftp.gnu.org/gnu/aspell/dict/0index.html . Use the latest filenames instead of aspell6-hi-0.02-0.tar.bz2 in following commands.

bunzip2 aspell6-hi-0.02-0.tar.bz2
tar xvf aspell6-hi-0.02-0.tar
cd aspell6-hi-0.02-0/
./configure
make
sudo make install


Dictionary values are hard-coded in Emacs code. We need to query aspell for the newly installed dictionary. Add this in ~/.emacs

(setq ispell-aspell-dictionary-alist nil)

In Emacs, select Hindi dictionary via M-x ispell-change-dictionary. Then you can use spell check shortcut M-$ for Hindi.

Side note: For some reason Indian fonts are not rendered correctly in the browsers in Linux. Changing the default fonts used by the browsers to Noto Sans Devanagari or Lohit-Devanagari solves it.

Auto-suggest

You can have auto-suggest for transliterated string by setting the following variable to the location of a word list (see Managing word list).
(setq ispell-complete-word-dict "/home/aspell6-hi-0.02-0/hi.wl"
         ispell-look-options nil)


Managing word list

For day to day usage, it's fine to maintain a personal word list (.wl extension). It's a simple text file. Keep adding entries to it in case it's missing from the dictionary (.cwl extension). However, if you have a sizeable word list, you might want to update the main dictionary. aspell provides some handy tools for the same.
 
Dictionary to word list
prezip -d hi.cwl
Word list to dictionary
prezip hi.wl
 

Comments

Popular posts from this blog

GNU Emacs as a Comic Book Reader

Mozilla Readability in GNU Emacs

Data Visualization with GNU Emacs