Spell Checking - Ignore Word Set

I am doing a bash script to check spelling on the number of files.

I ran into an aspell message problem to ignore some words that I allow to appear.

This is the same as Ignore Everything interactively. But this will not work, since I will need to do this manually.

How can I tell aspell to ignore a given set of words. Is there any parameter that can do this. I would like to transfer a file with these words.

Or could there be a more efficient way to spell check scripts in bash?

+4
source share
2 answers

Easy: put your words in the Personal dictionary: ~/.aspell.en.pws , where the first line

 personal_ws-1.1 en 500 

(500 is the number of words, it doesn't have to be exact; aspell will fix it if you add words with aspell).

If you need a dictionary elsewhere, use the following options:

 aspell --home-dir=/dir/to/dict --personal=dict-file.txt 
+5
source

This is written in a combination of shell and pseudocode. This does not seem to be the most efficient way; parsing two arrays and checking the results takes more memory and cycles than necessary.

 function SpellCheckInit() { for i in `seq 0 $(( ${#aname[@]} - 1 ))`; do echo Parsing... done } Dictionary=( "${dictionary[@]}" "Oxford English Dictionary" ) char=( "${words[@]}" "Text" ) echo Ignore? read -a omt_wrds SpellCheckInit() words_left=${#Dictionary[@]} until [ $words_left -lt 0]; do if [ "$char" = "i"]; do echo IGNORED elif [ "$char" = "$Dictionary"]; do echo CORRECT else for word in Dictionary $word > $dictionary done fi done 
0
source

Source: https://habr.com/ru/post/1339022/


All Articles