#include #include #include #include "WordT.h" using namespace std; /* struct WordT { std::string word; int count; }; */ void CombineWordT(WordT & first, WordT second) { if (first.word == second.word) { first.count += second.count; } } string StripWord(string word) { size_t i; string rv; for(i =0; i < word.size(); ++i) { if (isalpha(word[i])) { rv = rv + static_cast(tolower(word[i])); } } return rv; } WordT MakeWordT(std::string inWord){ WordT rv; rv.word = StripWord(inWord); rv.count = 1; return rv; } void PrintWordT(WordT entry){ cout << setw(20) << entry.word << setw(10) << entry.count << endl; return; }