Question: In this assignment, you are asked to write a C program that checks the spelling of words entered via standard input stream. The program must
In this assignment, you are asked to write a C program that checks the spelling of words entered via standard input stream. The program must output each misspelled word, its line and column of occurrence in the input, as well as possible corrections for the word.
Commandline Arguments
All commandline arguments are optional for this program. Here is the list of arguments and their meaning:
dictionaryfilename: the argument that comes after d specifies the name and possibly path of the file containing all English words listed with correct spelling. The default file name is "words.txt which refers to the file given on Canvas.
: means that the program must suggest possible corrections for any misspelled word by replacing one of its letters by another letter. For example, a possible correction forthe misspelled word "mistape" is "mistake" constructed by replacing by
: means that the program must suggest possible corrections for any misspelled word by swapping two adjacent letters of the word. For example, a possible correction for the misspelled word "pinaepple" is "pineapple" constructed by swapping a and e
: means that the program must suggest possible corrections for any misspelled word by erasing one letter of the word. For example, a possible correction for the misspelled word "earthqueake" is "earthquake" constructed by erasing the second letter from
the misspelled word.
Data Structure
To store the set of all words with correct spelling, you need to use the hashtable whose C implementation is given on Canvas hashsetc In this implementation, function setinit can be used to create an empty set, function insert can be used to add a new element to the set,
and function search can be used to search for a given element in the set.
Input and Output Format
You need to assume that the user can input up to lines made of many words, each with length less than characters. It is the responsibility of your program to remove all characters but az AZ and apostrophe egpunctuation marks, special characters, and
digits when checking the spelling of words.
The output of the program must be in the commaseparated value CSV format. For example, if the input has two misspelled words "miistake" Line Column and "aap" Line Column and the program is executed with flags rse", the generated output must
be this: "word,LnCol,Possible Correctionsmiistakemistakeaapbap,cap,gap,hap,jap,lap,map,nap,pap,rap,sap,tap,yap,zap,adp, alp,amp,app,asp,atp,aaa,aah,ap
Submission
You need to submit a zip file compressing the makefile, C source files and possibly any header files related to the assignment and. files Please use "spellchecker" as the name of your program's executable file in the makefile. The following is the expected output of the program: example:
Test Case #:
STDIN:
This is a flawless sentence!
CLAs:spellchecker
STDOUT:
word,LnCol,Possible Corrections
Test Case #:
STDIN:
This is a flawless sentence!
Here, you see one miistake.
There are issues: heaq and aap!!
CLAs:spellchecker d words.txt er s
STDOUT:
word,LnCol,Possible Corrections
miistake,mistake
heaq,hear,heat,head,heal,heap
aap,bap,cap,gap,hap,jap,lap,map,nap,pap,rap,sap,tap,yap,zap,adp,alp,amp,app,asp,atp,aaa,aah,ap
Test Case #:
STDIN:
pinaepple and appele are verry populer!
CLAs:spellchecker s e
STDOUT:
word,LnCol,Possible Corrections
pinaepple,pineapple
appele,apple
verry,very
populer,
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
