Implementation of LZ-index for extracting text
[SXSI/TextCollection.git] / lzindex / position.h
diff --git a/lzindex/position.h b/lzindex/position.h
new file mode 100644 (file)
index 0000000..f192c3f
--- /dev/null
@@ -0,0 +1,34 @@
+
+#ifndef POSITIONINCLUDED
+#define POSITIONINCLUDED
+
+//#include "lztrie.h"
+#include "nodemap.h"
+
+
+typedef struct tpos
+ {
+    uint *SuperBlock;  // array with starting positions of superblocks 
+    uint nSuperBlock;  // number of superblocks
+    uint nbitsSB;      // number of bits used for starting positions
+    uint SBlock_size;  // superblock size
+    uint *Offset;      // array of offsets of each phrase within each superblock
+    uint nOffset;      // size of the Offset array (number of LZ78 phrases)
+    uint nbitsOffs;    // number of bits used per offset
+    ulong Tlength;     // text length 
+ } *position;
+position createPosition(void *T, uint text_length);
+
+ulong getPosition(position P, uint id);
+
+ulong sizeofPosition(position P);
+
+void destroyPosition(position P);
+
+void savePosition(FILE *f, position P);
+
+position loadPosition(FILE *f, uint text_length);
+
+#endif