X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;ds=sidebyside;f=TextCollectionBuilder.h;h=6b3819a2ead0ff2aba0fa7ac9f3f350bd9ac556c;hb=47be601752d3cd9d24c831a16621cd6d4ced6670;hp=9bac6f90e1f0deae57b92dd1b520428aaf59b590;hpb=6e35318fa5b3d5630aa8e5c8ac019d62a47b8948;p=SXSI%2FTextCollection.git diff --git a/TextCollectionBuilder.h b/TextCollectionBuilder.h index 9bac6f9..6b3819a 100644 --- a/TextCollectionBuilder.h +++ b/TextCollectionBuilder.h @@ -22,7 +22,10 @@ #define _SXSI_TextCollectionBuilder_h_ #include "TextCollection.h" +#include "TextStorage.h" #include "Tools.h" // Defines ulong and uchar. + +#include #include #include // Defines std::pair. #include // Defines std::strlen, added by Kim @@ -58,17 +61,25 @@ namespace SXSI * Can not be called after makeStatic(). * The i'th text insertion gets an identifier value i-1. * In other words, document identifiers start from 0. + * + * Second parameter tells if the text will be added to the + * index also. If false, text is added only to the TextCollection + * and can not be searched for. */ - void InsertText(uchar const *); + void InsertText(uchar const *, bool index = true); /** * 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: + // Using Pimpl idiom to hide RLCSA implementation. struct TCBuilderRep * p_; // No copy constructor or assignment