1 7 7 1 dictionary.txt 1 cute 2 hello 3 ugly 4 easy 5 difficult 6 tired 7 beautiful synonyms 1 7 7 1 antonyms 1 3 3 1 7 4 5 5 4 7 3 #include #include #include #include #include using namespace std; class WordInfo{ public: WordInfo(){} ~WordInfo() { } int id() const {return myId;} void readWords(istream &in) { in>>myId>>word; } void pushSynonyms (string synline, vector wordInfoVector) { stringstream synstream(synline); vector synsAux; int num; while (synstream >> num) synsAux.push_back(num); cout< wordInfoVector) { } //--dictionary output function void printWords (ostream &out) { out< (const WordInfo &otherWordInfo)const {return word>otherWordInfo.word;} private: vector mySynonyms; vector myAntonyms; string word; int myId; }; //--Definition of input operator for WordInfo istream & operator >>(istream &in, WordInfo &word) { word.readWords(in); } //--Definition of output operator ostream & operator <<(ostream &out, WordInfo &word) { word.printWords(out); } int main() { string wordFile; cout<<"enter name of dictionary file: "; getline (cin,wordFile); ifstream inStream (wordFile.data()); if(!inStream.is_open()) { cerr<<"cannot open "< wordVector; WordInfo aword; while (inStream >>aword && (!(aword=="synonyms"))) { wordVector.push_back(aword); } inStream.clear(); // clears failbit on the ifstream int i=0; while (i intVector; string synLine; //suspect while (getline(inStream, synLine)&&(synLine!=("antonyms"))){ aword.pushSynonyms(synLine, wordVector); } system("PAUSE"); return 0; } cout<