}\r
\r
// OpenDocument(empty_texts): it starts the construction of the data structure for\r
// the XML document. Parameter empty_texts indicates whether we index empty texts\r
// in document or not. Returns a non-zero value upon success, NULLT in case of error.\r
}\r
\r
// OpenDocument(empty_texts): it starts the construction of the data structure for\r
// the XML document. Parameter empty_texts indicates whether we index empty texts\r
// in document or not. Returns a non-zero value upon success, NULLT in case of error.\r
TagName = new vector<string>();\r
tIdMap = new std::unordered_map<string,int>();\r
\r
TagName = new vector<string>();\r
tIdMap = new std::unordered_map<string,int>();\r
\r
-// document. Tree and tags are represented in the final form, dynamic data \r
-// structures are made static, and the flag "finished" is set to true. After that, \r
+// document. Tree and tags are represented in the final form, dynamic data\r
+// structures are made static, and the flag "finished" is set to true. After that,\r
//closing parenthesis for the tree root\r
//par_aux = (pb *)urealloc(par_aux, sizeof(pb)*(1+npar/(8*sizeof(pb))));\r
//setbit(par_aux, npar, CP);\r
//npar++;\r
//closing parenthesis for the tree root\r
//par_aux = (pb *)urealloc(par_aux, sizeof(pb)*(1+npar/(8*sizeof(pb))));\r
//setbit(par_aux, npar, CP);\r
//npar++;\r
// makes the text collection static\r
STOPTIMER(Parsing);\r
PRINTTIME("Parsing XML Document", Parsing);\r
// makes the text collection static\r
STOPTIMER(Parsing);\r
PRINTTIME("Parsing XML Document", Parsing);\r
- empty_texts_aux, // freed by the constructor\r
- tags_aux, //freed by the constructor\r
+ empty_texts_aux, // freed by the constructor\r
+ tags_aux, // freed by the constructor\r
// inserts a new opening parentheses in the bit sequence\r
if (sizeof(pb)*8*parArraySize == npar) { // no space left for the new parenthesis\r
par_aux = (pb *)urealloc(par_aux, sizeof(pb)*2*parArraySize);\r
parArraySize *= 2;\r
}\r
// inserts a new opening parentheses in the bit sequence\r
if (sizeof(pb)*8*parArraySize == npar) { // no space left for the new parenthesis\r
par_aux = (pb *)urealloc(par_aux, sizeof(pb)*2*parArraySize);\r
parArraySize *= 2;\r
}\r
if (tag_id == tIdMap->end()){\r
REGISTER_TAG(TagName,tIdMap,tagname);\r
i = TagName->size() - 1;\r
if (tag_id == tIdMap->end()){\r
REGISTER_TAG(TagName,tIdMap,tagname);\r
i = TagName->size() - 1;\r
// inserts a new closing parentheses in the bit sequence\r
if (sizeof(pb)*8*parArraySize == npar) { // no space left for the new parenthesis\r
par_aux = (pb *)urealloc(par_aux, sizeof(pb)*2*parArraySize);\r
parArraySize *= 2;\r
}\r
// inserts a new closing parentheses in the bit sequence\r
if (sizeof(pb)*8*parArraySize == npar) { // no space left for the new parenthesis\r
par_aux = (pb *)urealloc(par_aux, sizeof(pb)*2*parArraySize);\r
parArraySize *= 2;\r
}\r
\r
// if (tag_id == tIdMap->end()){\r
// REGISTER_TAG(TagName,tIdMap,tagname);\r
\r
// if (tag_id == tIdMap->end()){\r
// REGISTER_TAG(TagName,tIdMap,tagname);\r
tags_aux = (TagType *)urealloc(tags_aux, sizeof(TagType)*(npar + 1));\r
\r
tags_aux[npar] = CLOSING_TAG_ID; // inserts the new tag id within the preorder sequence of tags\r
tags_aux = (TagType *)urealloc(tags_aux, sizeof(TagType)*(npar + 1));\r
\r
tags_aux[npar] = CLOSING_TAG_ID; // inserts the new tag id within the preorder sequence of tags\r
\r
int n_eta_size = sizeof(uint)*(1+(npar-1)/(8*sizeof(uint)));\r
//see basics.h, recalloc resizes and sets the new area to 0.\r
\r
int n_eta_size = sizeof(uint)*(1+(npar-1)/(8*sizeof(uint)));\r
//see basics.h, recalloc resizes and sets the new area to 0.\r
empty_texts_aux = (uint *)urecalloc(empty_texts_aux,eta_size,n_eta_size);\r
eta_size = n_eta_size;\r
bitset(empty_texts_aux, npar-1); // marks the non-empty text with a 1 in the bit vector\r
empty_texts_aux = (uint *)urecalloc(empty_texts_aux,eta_size,n_eta_size);\r
eta_size = n_eta_size;\r
bitset(empty_texts_aux, npar-1); // marks the non-empty text with a 1 in the bit vector\r