X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=XMLTreeBuilder.cpp;h=9c7e3f6c941a008be31182d233d76d46d96a00ee;hb=8b92ac7e539c796ee3160078b5ca30537f26ea51;hp=3115e4d1d71ddb38059dc34c1cb626517cea1216;hpb=44c3b5aabb8782b15e66d7d14ab19b280d7eb20f;p=SXSI%2FXMLTree.git diff --git a/XMLTreeBuilder.cpp b/XMLTreeBuilder.cpp index 3115e4d..9c7e3f6 100644 --- a/XMLTreeBuilder.cpp +++ b/XMLTreeBuilder.cpp @@ -10,12 +10,15 @@ XMLTreeBuilder::~XMLTreeBuilder(){ // OpenDocument(empty_texts): it starts the construction of the data structure for // the XML document. Parameter empty_texts indicates whether we index empty texts // in document or not. Returns a non-zero value upon success, NULLT in case of error. -int XMLTreeBuilder::OpenDocument(bool empty_texts, int sample_rate_text, bool dtc) +int XMLTreeBuilder::OpenDocument(bool empty_texts, + int sample_rate_text, + bool dtc, + TextCollectionBuilder::index_type_t index_type) { npar = 0; parArraySize = 1; disable_tc = dtc; - + text_index_type = index_type; STARTTIMER(); par_aux = (pb *)umalloc(sizeof(pb)*parArraySize); @@ -39,7 +42,8 @@ int XMLTreeBuilder::OpenDocument(bool empty_texts, int sample_rate_text, bool dt if (disable_tc) TextBuilder = 0; else - TextBuilder = TextCollectionBuilder::create((unsigned)sample_rate_text, TextCollectionBuilder::index_type_default); + TextBuilder = TextCollectionBuilder::create((unsigned)sample_rate_text, index_type); + Text = 0; empty_texts_aux = (unsigned int *)ucalloc(sizeof(unsigned int),1); eta_size = sizeof(unsigned int); @@ -80,7 +84,8 @@ XMLTree *XMLTreeBuilder::CloseDocument() empty_texts_aux, // freed by the constructor tags_aux, //freed by the constructor Text, - disable_tc); + disable_tc, + text_index_type); return T; }