projects
/
SXSI
/
TextCollection.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Jouni's Incremental BWT integrated into TextCollection
[SXSI/TextCollection.git]
/
timeTextCollection.cpp
diff --git
a/timeTextCollection.cpp
b/timeTextCollection.cpp
index
91c9404
..
47d1976
100644
(file)
--- a/
timeTextCollection.cpp
+++ b/
timeTextCollection.cpp
@@
-18,8
+18,9
@@
static struct timeval t2;
-#include "TextCollection.h"
+#include "TextCollection
Builder
.h"
using SXSI::TextCollection;
using SXSI::TextCollection;
+using SXSI::TextCollectionBuilder;
int main(int argc, char**argv)
{
int main(int argc, char**argv)
{
@@
-35,7
+36,7
@@
int main(int argc, char**argv)
- TextCollection
*csa = TextCollection::InitTextCollection
(64);
+ TextCollection
Builder *tcb = new TextCollectionBuilder
(64);
STARTTIMER();
STARTTIMER();
@@
-44,7
+45,7
@@
int main(int argc, char**argv)
while (not(cin.eof()) && num_str < 100000 ){
getline(cin,str); // Read line by line.
if (str.compare("----------") == 0){
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();
if (num_str % 10000 == 0){
STOPTIMER();
@@
-65,7
+66,7
@@
int main(int argc, char**argv)
};
std::cerr << "Calling MakeStatic()\n";
};
std::cerr << "Calling MakeStatic()\n";
-
csa->MakeStatic
();
+
TextCollection *tc = tcb->InitTextCollection
();
std::cerr << "Statistics: " << num_str << " strings, " << max_str << " = max length\n";
int count;
std::cerr << "Statistics: " << num_str << " strings, " << max_str << " = max length\n";
int count;
@@
-74,7
+75,7
@@
int main(int argc, char**argv)
for (unsigned int i = 0; i < (sizeof(words)/sizeof(char*)) ; i++){
STARTTIMER();
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();
STOPTIMER();
time = GETTIME();
@@
-82,7
+83,7
@@
int main(int argc, char**argv)
STARTTIMER();
STARTTIMER();
- count =
csa
->Count((unsigned char*) words[i].c_str());
+ count =
tc
->Count((unsigned char*) words[i].c_str());
STOPTIMER();
time = GETTIME();
STOPTIMER();
time = GETTIME();
@@
-90,7
+91,7
@@
int main(int argc, char**argv)
STARTTIMER();
STARTTIMER();
- count =
csa
->CountContains((unsigned char*) words[i].c_str());
+ count =
tc
->CountContains((unsigned char*) words[i].c_str());
STOPTIMER();
time = GETTIME();
STOPTIMER();
time = GETTIME();
@@
-98,7
+99,7
@@
int main(int argc, char**argv)
STARTTIMER();
STARTTIMER();
- res =
csa
->Contains((unsigned char*) words[i].c_str());
+ res =
tc
->Contains((unsigned char*) words[i].c_str());
STOPTIMER();
time = GETTIME();
STOPTIMER();
time = GETTIME();