Question: #includeSpellChecker.h #include #include using std::map; using std::set; using std::pair; using std::string; using std::ifstream; using std::stringstream; using std::getline; SpellChecker::SpellChecker() {} SpellChecker::SpellChecker(string lang) {} SpellChecker::SpellChecker(string lang, string

 #include"SpellChecker.h" #include #include using std::map; using std::set; using std::pair; using std::string; #include"SpellChecker.h" #include #include

using std::map; using std::set; using std::pair; using std::string; using std::ifstream; using std::stringstream; using std::getline;

SpellChecker::SpellChecker() {}

SpellChecker::SpellChecker(string lang) {}

SpellChecker::SpellChecker(string lang, string valid_words_filename, string misspelled_filename) { ifstream correct_words(valid_words_filename.c_str()); if (correct_words) { string s; while (getline(correct_words, s)) { valid_words.insert(s); } }

ifstream wrong_words(misspelled_filename.c_str()); if (wrong_words) { string s1, s2; while (wrong_words >> s1) { getline(wrong_words, s2); misspelled.insert(pair(s1, s2)); } }

} bool SpellChecker::loadValidWords(string filename) { ifstream correct_words(filename.c_str()); if (correct_words) { valid_words.clear(); string s; while (getline(correct_words, s)) { valid_words.insert(s); } return true; } return false; } bool SpellChecker::loadMisspelledWords(string filename) { ifstream wrong_words(filename.c_str()); if (wrong_words) { misspelled.clear(); string s1, s2; while (wrong_words >> s1) { getline(wrong_words, s2); s2.erase(s2.begin()); misspelled.insert(pair(s1, s2)); } return true; } return false; } void SpellChecker::setBeginMarker(char begin) { begin_mark = begin; }

void SpellChecker::setEndMarker(char end) { end_mark = end; }

char SpellChecker::getBeginMarker() { return begin_mark; }

char SpellChecker::getEndMarker() { return end_mark; }

string SpellChecker::fixUp(string sentence) { stringstream buff(sentence); string result; string tmp; while (buff >> tmp) { string word; for (int i = 0; i = 'A' && tmp[i]

: #include"WordCounts.h" #include #include #include

using std::pair; using std::vector; using std::stringstream; using std::sort;

void WordCounts::countWords(string sentence) { stringstream buff(sentence); string tmp; while (buff >> tmp) { string word; for (int i = 0; i = 'A' && tmp[i] = 'a' && tmp[i] (word, 1)); else words[word]++; } }

int WordCounts::getCount(string word) { return words[word]; }

void WordCounts::resetCounts() { words.clear(); }

bool myfunction(pair i, pair j) { return (i>j); }

int WordCounts::mostCommon(string commonWords[], int wordCount[], int n) { // data stracture to sort words and count, by count vector > v;

for (map::iterator it = words.begin(); it != words.end(); it++) { v.push_back(pair(it->second, it->first)); } sort(v.begin(), v.end(), myfunction); for (int i = 0; i

i finish the coding,but there are something missed, can u help me fix it, thank you.and the question is showing below.using std::ifstream; using std::stringstream; using std::getline; SpellChecker::SpellChecker() {} SpellChecker::SpellChecker(string lang) {} SpellChecker::SpellChecker(string

lang, string valid_words_filename, string misspelled_filename) { ifstream correct_words(valid_words_filename.c_str()); if (correct_words) { strings; while (getline(correct_words, s)) { valid_words.insert(s); } } ifstream wrong_words(misspelled_filename.c_str()); if (wrong_words){ string s1, s2; while (wrong_words >> s1) { getline(wrong_words, s2); misspelled.insert(pair(s1,

Assignment 7 zip src/SpellChecker.cpp [A7]-... COG Submitterator: CSCI 13... src-File Manager -a ty 26 Mar, 01:56 COG Submitterator: CSCI 1300 Mozilla Firefox COG Submitterator: CSCI 1300 x 150% C a search A https://web-cog-csci1300.cs.colorado.ed u submit/ COG Submitterator: CSCI 1300 Submit History About Hel Logged in as hayu9382 Logout Results Score: 56.0 of 100 Return Code: 0 Status: complete Run UUID b7e97ead-13e9-44ad-981e-85a4cd97cofd Checking for Required Functions. Checking SpellChecker class functions MISSING SpellChecker SpellChecker MISSING Spell Checker Spellchecker (string lang) Found 8 10 required functions Checking WordCounts class functions. MISSING: WordCounts: :WordCounts Found 4 5 required functions ERROR: Could not find all required functions Ensure you are using void in 1 Grading Deductions Summary COG-Web Beta (commit fe57bbd) l Code and license on GitHub l Built by Andy Sayler and Others in Boulder, CO

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!