projects
/
SXSI
/
TextCollection.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added TextStorage class
[SXSI/TextCollection.git]
/
dynFMI.cpp
diff --git
a/dynFMI.cpp
b/dynFMI.cpp
index
0ab96bc
..
6d5f28c
100644
(file)
--- a/
dynFMI.cpp
+++ b/
dynFMI.cpp
@@
-49,8
+49,8
@@
DynFMI::~DynFMI(){
#if SAMPLE!=0
delete SampledSAPositionsIndicator;
#endif
#if SAMPLE!=0
delete SampledSAPositionsIndicator;
#endif
-
delete handle;
-
delete pos;
+
//
delete handle;
+
//
delete pos;
#if SAMPLE!=0
delete sampledSATree;
#endif
#if SAMPLE!=0
delete sampledSATree;
#endif
@@
-63,6
+63,7
@@
void DynFMI::deleteDynFMINodes(WaveletNode *n){
}
DynFMI::DynFMI(uchar *text, ulong x, ulong n, bool del){
}
DynFMI::DynFMI(uchar *text, ulong x, ulong n, bool del){
+ numberOfTexts = 0;
initEmptyDynFMI(text, x, n);
if (del) delete [] text;
}
initEmptyDynFMI(text, x, n);
if (del) delete [] text;
}
@@
-333,11
+334,11
@@
void DynFMI::initEmptyDynFMI(uchar *text, ulong x, ulong n){
this->sampledSATree = new SampledSATree();
#endif
this->sampledSATree = new SampledSATree();
#endif
- this->pos = new Pos(sampleInterval);
- this->handle = new Handle();
+
//
this->pos = new Pos(sampleInterval);
+
//
this->handle = new Handle();
- pos->handle=this->handle;
- handle->pos=this->pos;
+
//
pos->handle=this->handle;
+
//
handle->pos=this->pos;
}
}
@@
-573,21
+574,21
@@
ulong* DynFMI::locate(uchar *pattern){
#endif
// size must include endmarker!
#endif
// size must include endmarker!
-
ulong
DynFMI::addText(uchar const * str, ulong n){
+
void
DynFMI::addText(uchar const * str, ulong n){
ulong i;
#if SAMPLE!=0
bool sample = false;
#endif
ulong i;
#if SAMPLE!=0
bool sample = false;
#endif
- i
=pos->getSize()+
1;
-
-
ulong key = pos->appendText(n)
;
+ i
= numberOfTexts +
1;
+
+
numberOfTexts ++
;
// Adding an empty text (end-marker)
if (n == 1)
{
insert(str[0], i);
//if (del) delete [] str;
// Adding an empty text (end-marker)
if (n == 1)
{
insert(str[0], i);
//if (del) delete [] str;
- return
key
;
+ return;
}
insert(str[n-2],i); // insert second last character, corresponds to suffix of length 1
}
insert(str[n-2],i); // insert second last character, corresponds to suffix of length 1
@@
-616,11
+617,11
@@
ulong DynFMI::addText(uchar const * str, ulong n){
#endif
// if (del) delete [] str;
#endif
// if (del) delete [] str;
-
return key;
+
//
return key;
}
}
-ulong DynFMI::addTextFromFile(char* filename, ulong n){
+
/*
ulong DynFMI::addTextFromFile(char* filename, ulong n){
ulong i;
#if SAMPLE!=0
bool sample = false;
ulong i;
#if SAMPLE!=0
bool sample = false;
@@
-711,8
+712,8
@@
ulong DynFMI::addTextFromFile(char* filename, ulong n){
return key;
}
return key;
}
-
-
+*/
+/*
uchar* DynFMI::retrieveText(ulong key){
cout << "key: " << key << endl;
uchar *text=0;
uchar* DynFMI::retrieveText(ulong key){
cout << "key: " << key << endl;
uchar *text=0;
@@
-742,9
+743,9
@@
uchar* DynFMI::retrieveText(ulong key){
text[n-1] = 0;
return text;
text[n-1] = 0;
return text;
-}
-
+ }*/
+/*
bool DynFMI::deleteText(ulong key){
// TODO access two times, can do better
ulong i=handle->getPos(key); //=bwtEnd;
bool DynFMI::deleteText(ulong key){
// TODO access two times, can do better
ulong i=handle->getPos(key); //=bwtEnd;
@@
-777,7
+778,7
@@
bool DynFMI::deleteText(ulong key){
return true;
}
return true;
}
-
+*/
ulong DynFMI::getNumberOfSymbolsSmallerThan(uchar c){
int j = 256+c;
ulong r=0;
ulong DynFMI::getNumberOfSymbolsSmallerThan(uchar c){
int j = 256+c;
ulong r=0;