-#include "TextCollection.h"
+#include "TextCollectionBuilder.h"
using SXSI::TextCollection;
+using SXSI::TextCollectionBuilder;
int main(int argc, char**argv)
{
- TextCollection *csa = TextCollection::InitTextCollection(64);
+ TextCollectionBuilder *tcb = new TextCollectionBuilder(64);
STARTTIMER();
while (not(cin.eof()) && num_str < 100000 ){
getline(cin,str); // Read line by line.
if (str.compare("----------") == 0){
- csa->InsertText((unsigned char*) buffer.c_str());
+ tcb->InsertText((unsigned char*) buffer.c_str());
if (num_str % 10000 == 0){
STOPTIMER();
};
std::cerr << "Calling MakeStatic()\n";
- csa->MakeStatic();
+ TextCollection *tc = tcb->InitTextCollection();
std::cerr << "Statistics: " << num_str << " strings, " << max_str << " = max length\n";
int count;
for (unsigned int i = 0; i < (sizeof(words)/sizeof(char*)) ; i++){
STARTTIMER();
- is = csa->IsContains((unsigned char*) words[i].c_str());
+ is = tc->IsContains((unsigned char*) words[i].c_str());
STOPTIMER();
time = GETTIME();
STARTTIMER();
- count = csa->Count((unsigned char*) words[i].c_str());
+ count = tc->Count((unsigned char*) words[i].c_str());
STOPTIMER();
time = GETTIME();
STARTTIMER();
- count = csa->CountContains((unsigned char*) words[i].c_str());
+ count = tc->CountContains((unsigned char*) words[i].c_str());
STOPTIMER();
time = GETTIME();
STARTTIMER();
- res = csa->Contains((unsigned char*) words[i].c_str());
+ res = tc->Contains((unsigned char*) words[i].c_str());
STOPTIMER();
time = GETTIME();