From fdf29cca5a2df608373ffbeb3a4155876a55df2c Mon Sep 17 00:00:00 2001 From: nvalimak Date: Fri, 8 May 2009 12:04:29 +0000 Subject: [PATCH] Added GetText(i,j) git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/XMLTree@378 3cdefd35-fc62-479d-8e8d-bae585ffb9ca --- XMLTree.h | 7 +++++++ 1 file changed, 7 insertions(+) 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()); -- 2.17.1