AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Typo online check11/19/2023 ![]() ![]() The script contains a series of commands to find and display a list of the misspelled words. I run the script like this: $ findTypos myfile The task turned out to be a little trickier than I expected. I put a bash script together to see how well I could check the words in a file against the Linux words file (/usr/share/dict/words on my system). To view the suggested replacements, run a command like this: $ enchant -a myfile | grep : If you expect a lot of typos, you can use a command like the one below to tell you how many times each typo appears in the file: $ enchant -l myfile | uniq -c Using enchantĪ tool named “enchant” will list the words it considers typos with a command like this: $ enchant -l myfile & typoze 17 0: depose, typos, typo's, types, type, typo, topaz, topees, type's, typed, tapes, topee, Topsy, doze, pose, tape, tape's $ aspell International Ispell Version 3.1.20 (but really Aspell 0.60.8) If aspell responds with an asterisk (*), the word was spelled correctly. ![]() Type “aspell -a” as shown below and you can type a word and see the list of suggested replacements. You can also use aspell to check the spelling of a group of words. You can do this one instance at a time by typing "i" or as a group by typing "I".Īs a precaution, aspell creates a backup file (e.g., myfile.bak) of the file you are checking so that you can recover your typos if you find it necessary and repair words you might have changed in error. After all, it might be a term that aspell simply doesn’t recognize or an acronym. You can also decide to ignore what aspell deems a typo. If it’s a word that is likely to be repeated, you can press “R” instead and replace all instances of the word in the file. You can also replace a typo by typing “r” and then typing the word you want to use to replace it. Otherwise, it will move on to the next misspelled word. If it’s the only typo in the file, aspell will make the change and exit. If you want to replace the typo with one of the words listed, just use your keyboard to type the digit to the left of the word you want to select. Like typoze and I think I run into them far more often than I want. I wish that I could type with my eyes closed and never make a mistake. The first typo (or suspected typo) will be displayed with the text and background colors reversed as shown below. Otherwise, it will open with a display that contains the file text (or just the top lines depending on the length of the file) followed by a list of suggested replacement words and, below that, a list of the commands that you can run. If aspell detects no typos, it simply exits. ![]()
0 Comments
Read More
Leave a Reply. |