From: nvalimak Date: Fri, 9 Jan 2009 13:38:57 +0000 (+0000) Subject: Reduced functionality to save space X-Git-Url: http://git.nguyen.vg/gitweb/?a=commitdiff_plain;h=eb8c4383c94d465b888974afdab370ca013bbe01;p=SXSI%2FTextCollection.git Reduced functionality to save space git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/TextCollection@51 3cdefd35-fc62-479d-8e8d-bae585ffb9ca --- diff --git a/dynFMI.cpp b/dynFMI.cpp index 0ab96bc..6d5f28c 100644 --- a/dynFMI.cpp +++ b/dynFMI.cpp @@ -49,8 +49,8 @@ DynFMI::~DynFMI(){ #if SAMPLE!=0 delete SampledSAPositionsIndicator; #endif - delete handle; - delete pos; +// delete handle; +// delete pos; #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){ + numberOfTexts = 0; 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->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! -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 - 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; - return key; + return; } 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; - 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; @@ -711,8 +712,8 @@ ulong DynFMI::addTextFromFile(char* filename, ulong n){ return key; } - - +*/ +/* 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; -} - + }*/ +/* 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; } - +*/ ulong DynFMI::getNumberOfSymbolsSmallerThan(uchar c){ int j = 256+c; ulong r=0;