8

I have a tex file that I update regularly and want to check for spelling every time. I would like aspell to remember the mispelled words that I chose to ignore and automatically ignore them in every subsequent spellcheck. The way I do it so far is the following:

  • Check the file using aspell -t -c file.tex. After that, I know that whatever is left there that is misspelled can be ignored for the next time.
  • Do cat file.tex | aspell list -t | sort | uniq > dictionary.txt and then add personal_ws-1.1 en 162 as the first line of dictionary.txt. This will be a personal dictionary of things that can be ignored in every subsequent spell check.
  • Next time check the file with aspell --home-dir=. --personal=dictionary.txt -t -c file.tex

This works, but the problem is that I need to do this procedure every time I want to update the words that I want to ignore permanently. Is there a way to make aspell put the interactively ignored words in that file, automaticaally during the spell check? Or any other efficient way of achieving what I'm doing above?

1
  • 1
    For future users of this approach, since it puzzled me: in that first line to add to the dictionary, en is the language code, and the number after is a hint at the length of the list, and does not have to be accurate. See "Format of the Personal and Replacement Dictionaries" in the aspell docs for reference. Commented Mar 21, 2021 at 10:26

2 Answers 2

7

I found the answer after posting that question. Here's the solution:

  • Every time, run aspell with aspell --home-dir=. --personal=dictionary.txt -t -c file.tex
  • Instead of pressing "i" or "I" to ignore a word, just press "a" to add it to dictionary.txt.
1
  • Something that also works for me is to have a central dictionary.txt and then simply symlink that file to each folder I'm working on. Commented Jul 31, 2018 at 11:51
0

My version of aspell on Ubuntu 22.04 by default maintains a personal dictionary in $HOME called .aspell.en.pws. Words are added when pressing 'a' during an interactive session.

There's also a replacement dictionary called .aspell.en.prepl, which will remember if you replaced a word with one not in its dictionary.

See http://aspell.net/man-html/Format-of-the-Personal-and-Replacement-Dictionaries.html

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.