BinaryTree  HW 06
Spell Checking Using Binary Trees
 All Classes Files Functions Variables Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Dictionary Class Reference

Public Member Functions

 Dictionary (const string &dictfile)
 Creates a dictionary from a given file using the string name of the file in the same directory. More...
 
void debugStats (std::ostream &out)
 calls the TreeStringSet showStatistics function on the dictionary More...
 
void checkSpelling (std::istream &in)
 checks the spelling of each word and provides suggestions for words spelled incorrectly More...
 

Private Member Functions

string suggestSpelling (string checkee)
 Private helper function, returns a string with the item being checked and the possible suggestions. More...
 

Private Attributes

TreeStringSet dict_
 Holds the dictionary inside a TreeStringSet.
 

Constructor & Destructor Documentation

Dictionary::Dictionary ( const string &  dictfile)

Creates a dictionary from a given file using the string name of the file in the same directory.

Returns
Constructor does not return anything, but creates the dictionary.
Parameters
dictfileName of dictionary file.

Member Function Documentation

void Dictionary::checkSpelling ( std::istream &  in)

checks the spelling of each word and provides suggestions for words spelled incorrectly

Parameters
inStream to read from
void Dictionary::debugStats ( std::ostream &  out)

calls the TreeStringSet showStatistics function on the dictionary

Parameters
outStream to which the function should send to
string Dictionary::suggestSpelling ( string  checkee)
private

Private helper function, returns a string with the item being checked and the possible suggestions.

Returns
String in format checkee: suggestion1 sugestion 2 ...
Parameters
checkeeString to be checked

The documentation for this class was generated from the following files: