LZ index support
authornvalimak <nvalimak@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Fri, 29 May 2009 14:38:45 +0000 (14:38 +0000)
committernvalimak <nvalimak@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Fri, 29 May 2009 14:38:45 +0000 (14:38 +0000)
git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/TextCollection@419 3cdefd35-fc62-479d-8e8d-bae585ffb9ca

TextCollectionBuilder.cpp
TextCollectionBuilder.h

index 7228f72..467bf94 100644 (file)
@@ -95,7 +95,7 @@ void TextCollectionBuilder::InsertText(uchar const * text)
 }
 
 
-TextCollection * TextCollectionBuilder::InitTextCollection()
+TextCollection * TextCollectionBuilder::InitTextCollection(char type)
 {
     uchar * bwt = 0;
     CSA::usint length = 0;
@@ -151,7 +151,7 @@ TextCollection * TextCollectionBuilder::InitTextCollection()
     }
 
     TextCollection *result = new TCImplementation(bwt, (ulong)length, 
-                      p_->samplerate, p_->numberOfTexts, p_->maxTextLength, p_->numberOfSamples);
+                   p_->samplerate, p_->numberOfTexts, p_->maxTextLength, p_->numberOfSamples, type);
     return result;
 }
 
index 9bac6f9..1eb0275 100644 (file)
@@ -22,6 +22,7 @@
 #define _SXSI_TextCollectionBuilder_h_
 
 #include "TextCollection.h"
+#include "TextStorage.h"
 #include "Tools.h" // Defines ulong and uchar.
 #include <vector>
 #include <utility> // Defines std::pair.
@@ -63,10 +64,13 @@ namespace SXSI
         /**
          * Make static
          *
-         * Convert to a static collection; reduces space and time complexities.
+         * Convert to a static collection.
          * New texts can not be inserted after this operation.
+         *
+         * TextStorage type defaults to TYPE_PLAIN_TEXT, another
+         * possible type is TYPE_LZ_INDEX.
          */
-        TextCollection * InitTextCollection();
+        TextCollection * InitTextCollection(char type = TextStorage::TYPE_PLAIN_TEXT);
         
     private:
         struct TCBuilderRep * p_;