X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=XMLTree.h;h=9b79ae3eab6040b473c0eb65473aabf4ea4836bd;hb=06201fcce6255906ad6b4d305b8e643c634780a3;hp=1f8df578940a6b48dcce2e82ccc70a35c41344bf;hpb=05e2786e92c705a9efe2bfb3cb96fac6eed187c3;p=SXSI%2FXMLTree.git diff --git a/XMLTree.h b/XMLTree.h index 1f8df57..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(); @@ -232,7 +235,8 @@ public: * preorder than x and not in the subtree of x. Returns NULLT if there * is none. */ treeNode TaggedFoll(treeNode x, TagType tag); - + + treeNode TaggedFollBelow(treeNode x, TagType tag,treeNode root); /** TaggedFollowingSibling(x,tag) */ treeNode TaggedFollowingSibling(treeNode x, TagType tag); @@ -330,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) { @@ -419,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) {