X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=TextCollectionBuilder.h;h=1eb0275550fb05145972dfd0ad5399cf3400cdd0;hb=d660b6ec5cd55019d17188810b783a2e3a94fa49;hp=13734d22f74ec09f8c18cb2c04b39992dd131f89;hpb=f58cd5c3504095d721eb4e21bfb0a70a0a4928a2;p=SXSI%2FTextCollection.git diff --git a/TextCollectionBuilder.h b/TextCollectionBuilder.h index 13734d2..1eb0275 100644 --- a/TextCollectionBuilder.h +++ b/TextCollectionBuilder.h @@ -22,6 +22,7 @@ #define _SXSI_TextCollectionBuilder_h_ #include "TextCollection.h" +#include "TextStorage.h" #include "Tools.h" // Defines ulong and uchar. #include #include // Defines std::pair. @@ -33,6 +34,8 @@ // Default samplerate for suffix array samples #define TEXTCOLLECTION_DEFAULT_SAMPLERATE 64 +// Default input length, used to calculate the buffer size. +#define TEXTCOLLECTION_DEFAULT_INPUT_LENGTH (150 * 1024 * 1024) namespace SXSI @@ -45,7 +48,8 @@ namespace SXSI class TextCollectionBuilder { public: - explicit TextCollectionBuilder(unsigned samplerate = TEXTCOLLECTION_DEFAULT_SAMPLERATE); + explicit TextCollectionBuilder(unsigned samplerate = TEXTCOLLECTION_DEFAULT_SAMPLERATE, + ulong estimatedInputLength = TEXTCOLLECTION_DEFAULT_INPUT_LENGTH); ~TextCollectionBuilder(); /** @@ -60,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_;