//-------------------------------------------------------------------- // // TextAnalyst // //-------------------------------------------------------------------- #include //#include "stradt.h" #include "listarr.C" #include "wordcount.h" class TextAnalyst { public: // Constructors TextAnalyst (char* filename); // Create and initialize from file // Access operations void read (char* filename); // Re-initialize on a new file // Access operations int number_of_words (); double average_word_length (); Stradt longest_word (); Stradt shortest_word (); Stradt most_common_word (); int occurrences_of_most_common (); int super_long_word_occurs (); int qxz_word_occurs (); private: // Helper function for most common words and their counts WordCount find_most_common (); // Data members List< WordCount > * dictionary; // My collection of words and counts };