Ask Your Question

How to add words to system spell-check dictionary

asked 2017-02-20 03:26:50 -0500

terrycloth gravatar image

updated 2017-03-09 15:46:57 -0500

I'm trying to figure out how to add words to a spelling dictionary so that I get the most impact for the effort --- some way to have it apply to all applications, or at least as many of the ones I actually use as possible.

If I have to target specific spell checkers for specific applications, then I'm mostly interested in adding words to the spell checking dictionaries used by the applications I most often compose text with: Firefox for web forms, Evolution for email, Atom and gedit for code and plain text, and LibreOffice for office documents. Each of these applications has a way to add words to their own spelling dictionary, but those dictionaries are application-specific, and I would have to add a given word to all of them. So I've been hunting to see If they share a single spell-check system, or even if there's 2 or 3 systems that covers all of those. Here's what I've found out so far:

I notice my system in particular has these packages which match "spell" in the name, plus enchant:

  • aspell - 12:
  • gnome-python2-gtkspell - 2.25.3-48.fc25
  • gspell - 1.2.3-1.fc25
  • gtkspell - 2.0.16-11.fc24
  • gtkspell3 - 3.0.9-1.fc25
  • hunspell - 1.4.1-1.fc25
  • hunspell-en - 0.20140811.1-5.fc24
  • hunspell-en-GB - 0.20140811.1-5.fc24
  • hunspell-en-US - 0.20140811.1-5.fc24
  • enchant - 1:1.6.0-14.fc25
  • python3-enchant - 1.6.8-1.fc25

Wikipedia says hunspell replaces myspell and is widely used. rpm --query --requires says that Firefox and LibreOffice both depend on hunspell. Gedit uses gspell, which relies on enchant, which can use myspell as a backend --- and the directory /usr/share/myspell/ is actually owned by hunspell. Atom's spell-checking package searches in the myspell directory too, so it seems like I should have a good chance of doing everything I want to do from the hunspell configuration. So I tried creating a user addon dictionary by creating the file ~/.hunspell_en_US containing a few line-separated words (all lower case except for proper nouns, no /flags or anything). However, those words are still marked as a spelling error in all the applications I'm testing on, except for hunspell itself, via the command line tool.

Why isn't it working?

edit retag flag offensive close merge delete


And you have not only hunspell but also hunspell-en-US or hunspell-en-GB installed?

Did you see this post here?

florian gravatar imageflorian ( 2017-03-04 00:48:32 -0500 )edit

Yes, I also have hunspell-en, hunspell-en-US, andhunspell-en-GB installed.

I did eventually find and read the hunspell.5 syntax man page (currently, Fedora only includes that documentation in the hunspell-devel package). I don't entirely understand how all the flags work, but for a simple user dictionary which adds words for the existing language's dictionary, should basically just be a plain list of words separated by line breaks.

terrycloth gravatar imageterrycloth ( 2017-03-04 01:07:12 -0500 )edit

The rest of the StackOverflow thread seems to be about writing a language file from scratch, or integrating with a C# application, so I can't use the code snippets.

terrycloth gravatar imageterrycloth ( 2017-03-04 20:50:37 -0500 )edit

2 Answers

Sort by » oldest newest most voted

answered 2017-03-30 22:20:07 -0500

terrycloth gravatar image

updated 2017-03-30 22:21:13 -0500

The problem seems to be not with hunspell, or my dictionary, but in the applications and libraries which use hunspell not reading personal dictionaries. So I've filed some bug reports with the upstream projects:

edit flag offensive delete link more

answered 2017-03-05 04:12:55 -0500

Aeyoun gravatar image

As there isn’t one unified spellchecking system for that every program relies on, there isn’t one single place you can add custom words. You just have to manage it manually whenever you run into a missing word, unfortunately.

I worked on a library that would sync words between the most popular custom dictionaries some years. However, I never finished it because the task proved extremely complex. Many of the most popular programs have their own spellchecking systems, and lock their custom dictionaries while they’re running.

edit flag offensive delete link more


Okay, not everything uses hunspell or whatever. But LibreOffice and Firefox do --- or they're supposed to anyway. How come the list of words in my ~/.hunspell_en_US file are still being marked as misspelled?

terrycloth gravatar imageterrycloth ( 2017-03-05 16:18:08 -0500 )edit

Question Tools

1 follower


Asked: 2017-02-20 03:26:50 -0500

Seen: 856 times

Last updated: Mar 30 '17