The question given to us is 1. Implementation Read in a dictionary of common Eng
ID: 3529206 • Letter: T
Question
The question given to us is 1. Implementation Read in a dictionary of common English words from words.txt Read in an email with misspellings from email.txt For each word in the email, check whether the word is in the dictionary. Print out misspelled words. For each misspelled word, find the 20 most similar words from the dictionary where similarity is measured as the number of letters in common (ie intersect) divided by the max length of the misspelled word and dictionary word. Ask the user to select one of your suggestions or type in a new spelling. Correct the misspelled words in the email. Print out a spelling corrected version of the email into a file called email_correct.txt. What we have tried to dictionary = 'words.txt'; email = 'email.txt'; % read in the dictionary textarray = []; fid = fopen( 'Users ameDesktopwords.txt'); tline=fgetl(fid); while ischar(tline) disp(tline); tline = fgetl(fid); textarray{end+1} = tline; end fclose(fid); % read in the email textarray2 = []; fid = fopen('Users ameDesktopemail.txt'); tline=fgetl(fid); while ischar(tline) disp(tline); tline = fgetl(fid); textarray2{end+1} = tline; end fclose(fid); remain = textarray2 for k = 1:length(textarray2) [token, remain] = strtok(remain); token end % for each word in the email, check whether the word is in the dictionary************* (WE NEED HELP FROM THIS POINT ON) D = strcmp(email, dictionary) sum(D) count = 0 % print out misspelled words % for each misspelled word, find the 20 most similar words from the dictionary. % ask the user to select one of your suggestions or type in a new spelling. % correct the misspelled words in the email. word = input('Type in new spelling: ') % print out a new version of the email into this file: email_corrected = 'email_corrected.txt'; THANK YOUUUU!!!Explanation / Answer
http://www.mathworks.in/matlabcentral/fileexchange/25293-matlab-for-digital-communication/content/LZW_code.m
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.