hi, i have been given a project in c++ of making a mini search engine. i have to do index documents etc in it, iam giving details here, will some body tell me that how can i add document class objects 2 index class objects and do operations on it. you will see index class has a linked list in it, i have do all that with the new document object add. iam giving details below
////////////////////////
The addition to previous functions, the DocumentClass will also contain the following functions
DocumentClass doc;
doc = “f://doc1.text”; // this should assign a path of document
doc.documentLength(); // this should return the number of individual terms in a document
cout << doc; // this is a overloaded operator and should print individual terms of a document
String string1 = doc[2]; // this is a overloaded operator and should retrieve the third term of a document
int termF = doc.getTermFrequency(4); // this will return the term frequency of 5th term in the document
//////////////////////////////////
Index class
Each node in terms’ linked list should contain the following information
doc_id
term frequency
Each head pointer of terms' linked lists should contain the following information
Pointer to first node of linked list
Document Frequency: The term is present in how many number of documents
termCount: The total term count in all documents
minFreq: Minimum term frequency in linked list
maxFreq: Maximum term frequency in linked list
avgFreq: Average term frequency in linked list
////
The index class will contain the following functions
IndexClass index;
DocumentClass doc;
Index += doc; // this is overloaded operator and should add a new document in the index
Index -= (int doc_id); // this is overloaded operator and should delete the document with id (doc_id) from the indexer
Index -= (string termN); // this is overloaded operator and should delete all those documents that have term name given in second parameter
cout << index; // this will print all unique terms of a collection with the help of their names and document frequency
/////////////////
here is the problem, how can i perform operations and index the document in index class