This is a perl script that checks for spelling errors in the entered text.
Comparisions are made with the small dictionary; more words can be added using Add To Dictionary
option.
To run the script, first install a perl library that is necessary for script using this command:
sudo apt install libtext-levenshtein-perl
After successfully installing this library, run the script using:
perl main.pl
Now enter the text and follow the process.
- Please install the afore mentioned perl library, otherwise the program will generate error message.
- Current word being checked will be displayed in
RED
color and checked words will be displayed inGREEN
color. - In a
Y/N
input, onlyY
ory
will be considered asYes
, rest all inputs will be treated asNo
. - Initially, the dictionary cotains set of
LINUX Commands
only, hence regular english words will be shown as mis-spelled.
You can add such word to dictionary usingAdd To Dictionary
option while progran is running.
- Upon execution of the perl script, user will be asked to enter the text till he press
Enter
key. - Then all words of the input will undego spell check using
Edit Distance Algorithm
. - If a word is found in dictionary, process moves to next word.
- If not, then all words having edit distance of
1 unit
are given as suggestions to the user. - If no word in dictionary has an edit distance of 1 unit, then words having edit distance of
2 units
are given as suggestions. - There is also an option at end to add that word into the dictionary.
- Then user will be asked whether or not he wants to change the word with given suggestion.
- If
Y
ory
is given, user will be asked to enter suggestion number and word will be replaced with corresponding suggestion. - Any else response will move the process to next word.