X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=XMLTree.h;h=9b79ae3eab6040b473c0eb65473aabf4ea4836bd;hb=06201fcce6255906ad6b4d305b8e643c634780a3;hp=80173a4252cfb92b67ecf8fd18d156d80805ba2d;hpb=c1865639eb1a804ff9363035a2a656b64fd98b9e;p=SXSI%2FXMLTree.git diff --git a/XMLTree.h b/XMLTree.h index 80173a4..9b79ae3 100644 --- a/XMLTree.h +++ b/XMLTree.h @@ -21,7 +21,7 @@ #ifndef XMLTREE_H_ #define XMLTREE_H_ -#include "TextCollection/TextCollection.h" +#include "TextCollection/TextCollectionBuilder.h" #include #include #include @@ -37,6 +37,7 @@ #include #include using SXSI::TextCollection; +using SXSI::TextCollectionBuilder; // this constant is used to efficiently compute the child operation in the tree @@ -88,7 +89,9 @@ class XMLTree { uint tags_blen, tags_len; /** The texts in the XML document */ + TextCollectionBuilder *TextBuilder; TextCollection *Text; + /** The texts in the XML document (cached for faster display) */ vector CachedText; @@ -125,7 +128,7 @@ public: void print_stats(); /** Data structure constructor */ - XMLTree() {finished = false; initialized = false;}; + XMLTree() {finished = false; initialized = false; Text = 0; TextBuilder = 0; }; /** Data structure destructor */ ~XMLTree(); @@ -331,7 +334,7 @@ public: TagType RegisterTag(unsigned char *tagname); bool EmptyText(DocID i) { - return Text->EmptyText(i); + return Text->EmptyText(i); } /** Prefix(s): search for texts prefixed by string s. */ TextCollection::document_result Prefix(uchar const *s) { @@ -420,7 +423,7 @@ public: /** GetText(d): returns the text corresponding to document with * id d. */ uchar* GetText(DocID d) { - return Text->GetText(d); + return Text->GetText(d); } uchar* GetCachedText(DocID d) {