How to find and fix spelling errors on Linux

Let's dispose of typose!

1) typos                                6) Topsy
2) types                                7) tapes
3) typo's                               8) pose
4) depose                               9) type
5) tops                                 0) type's
i) Ignore                               I) Ignore all
r) Replace                              R) Replace all
a) Add                                  l) Add Lower
b) Abort                                x) Exit

The 1-0 entries in the output in the top 5 lines above are the potential replacements for the mistyped word. Note that the first entry in this case is the closest match. Press the number for the selected replacement and aspell will do the rest. To replace it with something else, press “r” (replace) and you’ll be prompted for the replacement.

You could also choose to ignore this misspelling and move on to the next by selecting “i” (Ignore) or ignore multiple misspellings of the word with “I” (Ignore all). To replace all instances of a particular misspelling (one that appears multiple times in the file) with something you’ll be prompted to enter, choose R (Replace all). The listed options in the bottom four lines help to select what you want to do.

If a file contains multiple typos, aspell will manage them one at a time. Decide what should be done with the first and it will move to the second, etc.

The aspell tool gets its vocabulary from the words file (/usr/share/dict/words on my system). Even if a file contains my first name “Sandra”, it’s accepted as OK. This words file includes a good collection of first names.

The aspell command also saves a backup (goal.bak in the example above) if changes are made to the file in case you need to revert to the original file for any reason.

You can also use aspell to check the spelling of a group of words. Type “aspell -a” as shown below and you can type a word or two and see the list of suggested replacements. If aspell responds with an asterisk (*), the word was spelled correctly. Otherwise, it provides possible replacements. Replacements for the misspelling “quagmyre” are shown below following the misspelling. The word “existential” was properly spelled so it’s followed by an asterisk.



Source link