There are many tools and resources that will be helpful for non-native English-speaking people to be more efficient in English learning. A while ago, I have posted The Ultimate offline Dictionary with Dictd in Linux. Today I’d like to share some other tools I use on a daily base. And hopefully this will be of help to someone.
A thorough list of appz for spell and grammar checker can be found at Language checking – ArchWiki. But, there is one must-have tool missing from the list – the EmacsWiki: Predictive Mode, which I can’t live without. I will start with the magic predictive-mode.
Emacs predictive mode
Refer to the instructions from EmacsWiki and its Completion User Manual to install. The following is my config init setting.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
(require 'predictive) (setq ;;predictive-main-dict 'rpg-dictionary predictive-auto-learn t predictive-add-to-dict-ask t predictive-use-auto-learn-cache t predictive-which-dict t) (predictive-mode 1) (setq auto-completion-syntax-alist (quote ((t accept . word)))) ;; Use space and punctuation to accept the current the most likely completion. (setq auto-completion-min-chars (quote ((t . 4)))) ;; Avoid completion for short trivial words. (global-set-key [f7] 'predictive-mode) ;; auto complete file (setq completion-at-point-functions '(elisp-completion-at-point comint-dynamic-complete-filename t)) |
hunspell Package
Hunspell is a free spell checker and morphological analyzer library and command-line tool, with lots of dictionaries in AUR. It is the most popular spellchecking library.
1 2 3 4 5 6 7 |
# installation sudo pacman -S hunspell hunspell -D # list the path for dict hunspell -d en_US,en_med_glut # exact name of the *dic file # or ln with an more readable, such as en_US_med # then enter word for spellcheck, e.g., astromreplicell, Polychondritis, Rheumatoid |
Medical Dictionaries
A succinct tutorial post here: Hunspell for medical terms spell-checking – More Power Later
And, there are two versions of the dictionaries. The first one is twice the 2nd one, so use the 1st one.
- glutanimate/hunspell-en-med-glut: Hunspell dictionary of English medical terms
- OpenMedSpel for Hunspell – Free Software Directory
You can use method here to put the *.dic file under listed paths from hunspell -D command. Or, you can follow the its own instruction as follows:
1 2 3 4 5 6 |
git clone https://github.com/Glutanimate/hunspell-en-med-glut.git cd hunspell-en-med-glut sudo cp en_med_glut.dic '/usr/share/hunspell/en_med_glut.dic' sudo mkdir -p /var/lib/dictionaries-common/hunspell sudo cp hunspell-en-med-glut /var/lib/dictionaries-common/hunspell/hunspell-en-med-glut |
Check it out with some medical terms (e.g., astromreplicell, Polychondritis, Rheumatoid) from the command-line:
1 2 3 4 5 |
# then enter word for spellcheck, e.g., astromreplicell, Polychondritis, Rheumatoid hunspell -d en_US,en_med_glut # or, with a file hunspell -d en_US,en_med_glut -a < input_file.txt |
NOTES: Invoke with the exact baseename of the *dic file, or ln -s with an more readable, such as en_US_med.
Spellcheck for Emacs
Bare minimum init setting with the following:
1 2 3 4 |
(setq ispell-program-name "hunspell") (setq ispell-local-dictionary "en_US") (setq ispell-local-dictionary-alist '(("en_US" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-d" "en_US,en_med_glut") nil utf-8))) |
Get some tips and trick from Fly Spell. Also refer to the config yet: What’s the best spell check setup in emacs | Chen’s blog.
Languagetool (LT)
LT is the most popular spell AND grammar checker for more than 20 languages.
LanguageTool – Spell and Grammar Checker.
Installation in Arch Linux:
1 2 |
sudo pacman -S languagetool |
Emacs configuration mhayashi1120/Emacs-langtool: LanguageTool for Emacs:
1 2 3 |
(setq langtool-(looking-at )nguage-tool-jar "/path/to/languagetool-commandline.jar") (require 'langtool) |
Manually add words to Langtool, Create own dictionary · Issue #839 · languagetool-org/languagetool.
1 2 |
sudo nano /usr/share/languagetool/org/languagetool/resource/en/hunspell/spelling_custom.txt |
Add personal dictionary generated by flyspell in Emacs to langtool:
1 2 |
sudo sh -c 'cat /home/tan/.hunspell_en_US > /usr/share/languagetool/org/languagetool/resource/en/hunspell/spelling_custom.txt' |
Additional Notes
- ☐ with flyspell check, SPC to skip, i and then y to add to personal dictionary,
- ☐ C-u M-$ to resume flyspell
- ☐ the personal dictionary for aspell is ~/.aspell.en.prepl ~/.aspell.en.pws for hunspell is ~./.hunspell_en_US
- ☐ Medical dictionaries add to ~/Library/Spelling picked by hunspell, NOT from /usr/share/myspell/.
- ☐ hunspell -D to list the dict path
JUL
About the Author:
Beyond 8 hours - Computer, Sports, Family...