From: nvalimak Date: Fri, 8 May 2009 12:04:29 +0000 (+0000) Subject: Added GetText(i,j) X-Git-Url: http://git.nguyen.vg/gitweb/?p=SXSI%2FXMLTree.git;a=commitdiff_plain;h=fdf29cca5a2df608373ffbeb3a4155876a55df2c Added GetText(i,j) git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/XMLTree@378 3cdefd35-fc62-479d-8e8d-bae585ffb9ca --- diff --git a/XMLTree.h b/XMLTree.h index 8057773..6a722f9 100644 --- a/XMLTree.h +++ b/XMLTree.h @@ -394,6 +394,13 @@ public: return (s[0] == 1 ? (uchar*)"" : s); } + /** GetText(i, j): returns the texts corresponding to documents with + * ids i, i+1, ..., j. Texts are separated by '\0' character. */ + uchar* GetText(DocID i, DocID j) { + uchar * s = Text->GetText(i, j); + return (s[0] == 1 ? (uchar*)"" : s); + } + uchar* GetCachedText(DocID d) { uchar * str = (uchar*) calloc(sizeof(char),(CachedText->at(d).size() + 1)); strcpy((char*) str,(const char*) CachedText->at(d).c_str());