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
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
} 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
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
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
int WordCounts::mostCommon(string commonWords[], int wordCount[], int n) { // data stracture to sort words and count, by count vector
for (map i finish the coding,but there are something missed, can u help me fix it, thank you.and the question is showing below. 



Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
