/* WordCount.cpp Dave Klick CIS 250 2018-02-10 This program tokenizes a text file into words, converts them to lowercase, stores them in a binary search tree, and then displays the word counts and then goes back through the file deleting the words from the tree. */ #include "Bintree.h" #include #include #include #include #include #include #include #include #include using std::cout; using std::endl; using std::ifstream; using std::string; using std::vector; using std::ios; using std::ptr_fun; string convert(string& s); void tokenize(vector& v, string line); int main(int argc, char* argv[]) { ifstream infile; string line; // *** Create a Bintree that holds string objects and name the variable "tree" vector v; for (int argNum=1; argNum= 0x80) { if (c >= 0xc0 && cvrt[c-0xc0] != 0) word[i] = (char) cvrt[c-0xc0]; else word[i] = ' '; } } return word; } void tokenize(vector& v, string line) { static const char* delims = " -\"\'?!,;:.()_`*/[]#%@$&{}<=>\\"; v.clear(); char* tempstr = new char[line.length()+1]; for (unsigned int i=0; i