#include #include /* this was clipped out of out main experiment to help find out how many unique words there are in the text file. It was run like this: a.out < /home/www/text/abbot/flatland | sort -u | wc which revealed that there are 4767 unique words in the file */ string cleanup(string s) { string r = ""; for (int i = 0; i < s.length(); i += 1) { char c = s[i]; if (isalpha(c)) r += (char)tolower(c); } return r; } void main() { while (true) { string s; cin >> s; if (cin.fail()) break; s = cleanup(s); if (s == "") continue; cout << s << "\n"; } }