X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=XMLTree.h;h=e8cc76a42879450f1695f08e6150088a0f8c3e38;hb=d1f17224ed40165c284145ffbfcc1bd42882f825;hp=9b55617e0105add000a39428462ce4958b59b1df;hpb=3c2f48fd3166bb5b65594012d6cc9b0236c390f9;p=SXSI%2FXMLTree.git diff --git a/XMLTree.h b/XMLTree.h index 9b55617..e8cc76a 100644 --- a/XMLTree.h +++ b/XMLTree.h @@ -21,16 +21,15 @@ #ifndef XMLTREE_H_ #define XMLTREE_H_ - +#include "TextCollection/TextCollection.h" #include #include +#include #include "bp.h" -#include "TextCollection/TextCollection.h" -using SXSI::TextCollection; #include #include #include - +using SXSI::TextCollection; // this constant is used to efficiently compute the child operation in the tree @@ -38,6 +37,8 @@ using SXSI::TextCollection; #define NULLT -1 +#define PERM_SAMPLE 10 + // sets bit p in e #define bitset(e,p) ((e)[(p)/W] |= (1<<((p)%W))) // cleans bit p in e @@ -68,7 +69,7 @@ class XMLTree { static_bitsequence_rrr02 *EBVector; /** Tag sequence represented with a data structure for rank and select */ - static_sequence_wvtree *Tags; + static_sequence *Tags; /** The texts in the XML document */ TextCollection *Text; @@ -86,6 +87,7 @@ class XMLTree { pb *par_aux; TagType *tags_aux; int npar; + int parArraySize; int ntagnames; unsigned int *empty_texts_aux; @@ -252,6 +254,10 @@ public: * Returns NULL in case that the tag identifier is not valid.*/ unsigned char *GetTagName(TagType tagid); + /** Prefix(s): search for texts prefixed by string s. */ + bool EmptyText(DocID i) { + return Text->EmptyText(i); + } /** Prefix(s): search for texts prefixed by string s. */ TextCollection::document_result Prefix(uchar const *s) { return Text->Prefix(s); @@ -334,9 +340,12 @@ public: /** GetText(d): returns the text corresponding to document with * id d. */ uchar* GetText(DocID d) { - Text->GetText(d); + return Text->GetText(d); } + TextCollection *getTextCollection() { + return Text; + } /** Save: saves XML tree data structure to file. */ void Save(unsigned char *filename);