#include #include #include #include "trie.h" using namespace std; int main() { ifstream infile("words2.txt"); trie T; string word; while (infile >> word) { int freq; infile >> freq; //throw away for now T.insert(word); } //(bad) autocompleter while (true) { cout << "Enter a prefix: " << endl; string pre; cin >> pre; string completion = T.badCompletion(pre); cout << "You were trying to type: " << completion << endl; } //T.insert("dog"); //T.insert("leet"); //T.insert("door"); return 0; }