X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=XMLTree.h;h=ba01941218fbab46860efba61abd6a6d4b2c990d;hb=1c3300373a43062be9bb8d23faf3c8446f9aa6c5;hp=319b9a69e841d6bc8878615aa243539ba2044153;hpb=e421727c5a512154cf2c3ff4cf8390eb88d527d7;p=SXSI%2FXMLTree.git diff --git a/XMLTree.h b/XMLTree.h index 319b9a6..ba01941 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" +#include +#include +#include using SXSI::TextCollection; -#include "libcds/includes/static_bitsequence.h" -#include "libcds/includes/alphabet_mapper.h" -#include "libcds/includes/static_sequence.h" - // this constant is used to efficiently compute the child operation in the tree @@ -254,32 +253,87 @@ public: /** Prefix(s): search for texts prefixed by string s. */ TextCollection::document_result Prefix(uchar const *s) { - Text->Prefix(s); + return Text->Prefix(s); } /** Suffix(s): search for texts having string s as a suffix. */ TextCollection::document_result Suffix(uchar const *s) { - Text->Suffix(s); + return Text->Suffix(s); } /** Equal(s): search for texts equal to string s. */ TextCollection::document_result Equal(uchar const *s) { - Text->Equal(s); + return Text->Equal(s); } /** Contains(s): search for texts containing string s. */ TextCollection::document_result Contains(uchar const *s) { - Text->Contains(s); + return Text->Contains(s); } + /** LessThan(s): returns document identifiers for the texts that + * are lexicographically smaller than string s. */ TextCollection::document_result LessThan(uchar const *s) { - Text->LessThan(s); + return Text->LessThan(s); } - + + /** IsPrefix(x): returns true if there is a text prefixed by string s. */ + bool IsPrefix(uchar const *s) { + return Text->IsPrefix(s); + } + + /** IsSuffix(s): returns true if there is a text having string s as a + * suffix.*/ + bool IsSuffix(uchar const *s) { + return Text->IsSuffix(s); + } + + /** IsEqual(s): returns true if there is a text that equals given + * string s. */ + bool IsEqual(uchar const *s) { + return Text->IsEqual(s); + } + + /** IsContains(s): returns true if there is a text containing string s. */ + bool IsContains(uchar const *s) { + return Text->IsContains(s); + } + + /** IsLessThan(s): returns true if there is at least a text that is + * lexicographically smaller than string s. */ + bool IsLessThan(uchar const *s) { + return Text->IsLessThan(s); + } + + /** CountPrefix(s): counting version of Prefix(s). */ + unsigned CountPrefix(uchar const *s) { + return Text->CountPrefix(s); + } + + /** CountSuffix(s): counting version of Suffix(s). */ + unsigned CountSuffix(uchar const *s) { + return Text->CountSuffix(s); + } + + /** CountEqual(s): counting version of Equal(s). */ + unsigned CountEqual(uchar const *s) { + return Text->CountEqual(s); + } + + /** CountContains(s): counting version of Contains(s). */ + unsigned CountContains(uchar const *s) { + return Text->CountContains(s); + } + + /** CountLessThan(s): counting version of LessThan(s). */ + unsigned CountLessThan(uchar const *s) { + return CountLessThan(s); + } + /** GetText(d): returns the text corresponding to document with * id d. */ uchar* GetText(DocID d) { - Text->GetText(d); + return Text->GetText(d); } /** Save: saves XML tree data structure to file. */