// Dictionary.h // a vector of pointers to trees 'a' through 'z'. // each vector element points to a BST holding words // for example the vector element 'a' would point to // a BST with all words beginning with the letter 'a' #ifndef DICTIONARY_CLASS #define DICTIONARY_CLASS #include #include #include "Bst.h" class Dictionary { std::vector alphabet; public: // default constructor // initializes word to "" and left and right to NULL Dictionary(); // copy constructor // makes a copy of "other" // calls copy() Dictionary(const Dictionary & other); // destructor // calls makeEmpty() ~Dictionary(); // assignment operator Dictionary & operator=(const Dictionary &); // prints all words in the dictionary // calls Bst print function void print(); // adds a word to the dictionary in the appropriate place // returns true if successfully added // otherwise returns false bool add(std::string word); // removes word from dictionary - NOT dictionary.txt // but rather removes it from the BST // dictionary.txt file DOES NOT CHANGE only // "word" gets removed from the dictionary in memory // returns true if successfully removed // returns false otherwise bool remove(std::string word); // returns true if word exists, false otherwise bool exists(std::string word); // reads all words in dictionary from // the file: dictionary.txt // each word appears on a line by itself followed // by a newline void reader(); private: // YOU MAY PLACE ANY PRIVATE FUNCTIONS NEEDED HERE }; #endif // DICTIONARY_CLASS