X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=CSA.h;h=df56585064171bbc4336b81e30aa34c4439a17bc;hb=663cd2f6cc5e3796d001e8c527de0aea8c8bbf68;hp=e5852b9dc2b30b3fd10c9cfd42f211e61bb94c10;hpb=2e59e4488d8d8ab43d6a28d40f81c7df6f811d56;p=SXSI%2FTextCollection.git diff --git a/CSA.h b/CSA.h index e5852b9..df56585 100644 --- a/CSA.h +++ b/CSA.h @@ -20,25 +20,29 @@ #ifndef _CSA_H_ #define _CSA_H_ +#include "dynFMI.h" +#include "BitRank.h" +#include "TextCollection.h" +#include "BlockArray.h" +#include "RLWaveletTree.h" +#include +#include + // Include from XMLTree/libcds #include #include #include #include -//clash between TextCollection/Tools.h and libcds/includes/basics.h -// Number of bits in ulong vs uint. +// Re-define word size to ulong: #undef W -#undef WW -#undef Wminusone +#if __WORDSIZE == 64 +# define W 64 +#else +# define W 32 +#endif +#undef bitset -#include "dynFMI.h" -#include "BitRank.h" -#include "TextCollection.h" -#include "BlockArray.h" -#include "RLWaveletTree.h" -#include -#include /** * Implementation of the TextCollection interface @@ -70,6 +74,11 @@ public: void MakeStatic(); bool EmptyText(DocId) const; uchar* GetText(DocId) const; + /** + * Next method is not supported: + * Supporting GetText for some substring [i,j] + * would require more space. + */ // uchar* GetText(DocId, TextPosition, TextPosition) const; bool IsPrefix(uchar const *) const; @@ -78,6 +87,7 @@ public: bool IsContains(uchar const *) const; bool IsLessThan(uchar const *) const; + ulong Count(uchar const *) const; unsigned CountPrefix(uchar const *) const; unsigned CountSuffix(uchar const *) const; unsigned CountEqual(uchar const *) const; @@ -125,6 +135,7 @@ public: } private: + // FIXME Unused code class TCodeEntry { public: unsigned count; @@ -134,6 +145,7 @@ private: }; + // FIXME Unused code class THuffAlphabetRank { // using fixed 0...255 alphabet private: @@ -220,6 +232,7 @@ private: } }; + // FIXME Unused code class node { private: unsigned weight; @@ -253,6 +266,7 @@ private: static TCodeEntry *makecodetable(uchar *, TextPosition); }; + // FIXME Unused code static const unsigned char print = 1; static const unsigned char report = 1; static const uchar versionFlag;