projects
/
SXSI
/
XMLTree.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add some more file from libcds HEAD
[SXSI/XMLTree.git]
/
XMLTree.h
diff --git
a/XMLTree.h
b/XMLTree.h
index
9b55617
..
7407014
100644
(file)
--- a/
XMLTree.h
+++ b/
XMLTree.h
@@
-21,16
+21,15
@@
\r
#ifndef XMLTREE_H_
\r
#define XMLTREE_H_
\r
\r
#ifndef XMLTREE_H_
\r
#define XMLTREE_H_
\r
-
\r
+#include "TextCollection/TextCollection.h"
\r
#include <stdio.h>
\r
#include <stdlib.h>
\r
#include <stdio.h>
\r
#include <stdlib.h>
\r
+#include <cstring>
\r
#include "bp.h"
\r
#include "bp.h"
\r
-#include "TextCollection/TextCollection.h"
\r
-using SXSI::TextCollection;
\r
#include <static_bitsequence.h>
\r
#include <alphabet_mapper.h>
\r
#include <static_sequence.h>
\r
#include <static_bitsequence.h>
\r
#include <alphabet_mapper.h>
\r
#include <static_sequence.h>
\r
-
\r
+using SXSI::TextCollection;
\r
\r
\r
// this constant is used to efficiently compute the child operation in the tree
\r
\r
\r
// this constant is used to efficiently compute the child operation in the tree
\r
@@
-38,6
+37,8
@@
using SXSI::TextCollection;
\r
#define NULLT -1
\r
\r
\r
#define NULLT -1
\r
\r
+#define PERM_SAMPLE 10
\r
+
\r
// sets bit p in e
\r
#define bitset(e,p) ((e)[(p)/W] |= (1<<((p)%W)))
\r
// cleans bit p in e
\r
// sets bit p in e
\r
#define bitset(e,p) ((e)[(p)/W] |= (1<<((p)%W)))
\r
// cleans bit p in e
\r
@@
-68,7
+69,7
@@
class XMLTree {
static_bitsequence_rrr02 *EBVector;
\r
\r
/** Tag sequence represented with a data structure for rank and select */
\r
static_bitsequence_rrr02 *EBVector;
\r
\r
/** Tag sequence represented with a data structure for rank and select */
\r
- static_sequence
_wvtree
*Tags;
\r
+ static_sequence *Tags;
\r
\r
/** The texts in the XML document */
\r
TextCollection *Text;
\r
\r
/** The texts in the XML document */
\r
TextCollection *Text;
\r
@@
-86,6
+87,7
@@
class XMLTree {
pb *par_aux;
\r
TagType *tags_aux;
\r
int npar;
\r
pb *par_aux;
\r
TagType *tags_aux;
\r
int npar;
\r
+ int parArraySize;
\r
int ntagnames;
\r
unsigned int *empty_texts_aux;
\r
\r
int ntagnames;
\r
unsigned int *empty_texts_aux;
\r
\r
@@
-334,9
+336,12
@@
public:
/** GetText(d): returns the text corresponding to document with
\r
* id d. */
\r
uchar* GetText(DocID d) {
\r
/** GetText(d): returns the text corresponding to document with
\r
* id d. */
\r
uchar* GetText(DocID d) {
\r
- Text->GetText(d);
\r
+
return
Text->GetText(d);
\r
}
\r
\r
}
\r
\r
+ TextCollection *getTextCollection() {
\r
+ return Text;
\r
+ }
\r
/** Save: saves XML tree data structure to file. */
\r
void Save(unsigned char *filename);
\r
\r
/** Save: saves XML tree data structure to file. */
\r
void Save(unsigned char *filename);
\r
\r