Added GetText(i,j)
authornvalimak <nvalimak@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Fri, 8 May 2009 12:04:29 +0000 (12:04 +0000)
committernvalimak <nvalimak@3cdefd35-fc62-479d-8e8d-bae585ffb9ca>
Fri, 8 May 2009 12:04:29 +0000 (12:04 +0000)
git-svn-id: svn+ssh://idea.nguyen.vg/svn/sxsi/trunk/XMLTree@378 3cdefd35-fc62-479d-8e8d-bae585ffb9ca

XMLTree.h

index 8057773..6a722f9 100644 (file)
--- a/XMLTree.h
+++ b/XMLTree.h
@@ -394,6 +394,13 @@ public:
      return (s[0] == 1 ? (uchar*)"" : s);\r
    }\r
 \r
+   /** GetText(i, j): returns the texts corresponding to documents with\r
+    * ids i, i+1, ..., j. Texts are separated by '\0' character.  */\r
+   uchar* GetText(DocID i, DocID j) {\r
+     uchar * s = Text->GetText(i, j);\r
+     return (s[0] == 1 ? (uchar*)"" : s);\r
+   }\r
+\r
    uchar* GetCachedText(DocID d) {\r
      uchar * str = (uchar*) calloc(sizeof(char),(CachedText->at(d).size() + 1));\r
      strcpy((char*) str,(const char*) CachedText->at(d).c_str());\r