X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=CSA.h;h=df56585064171bbc4336b81e30aa34c4439a17bc;hb=663cd2f6cc5e3796d001e8c527de0aea8c8bbf68;hp=4303b53f582f571da0122fd5373910d5312fa06f;hpb=9c741e645d2c51f59b7cc40bf9ca0a91e1ed51d4;p=SXSI%2FTextCollection.git diff --git a/CSA.h b/CSA.h index 4303b53..df56585 100644 --- a/CSA.h +++ b/CSA.h @@ -34,6 +34,16 @@ #include #include +// Re-define word size to ulong: +#undef W +#if __WORDSIZE == 64 +# define W 64 +#else +# define W 32 +#endif +#undef bitset + + /** * Implementation of the TextCollection interface * @@ -64,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; @@ -72,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; @@ -119,6 +135,7 @@ public: } private: + // FIXME Unused code class TCodeEntry { public: unsigned count; @@ -128,6 +145,7 @@ private: }; + // FIXME Unused code class THuffAlphabetRank { // using fixed 0...255 alphabet private: @@ -214,6 +232,7 @@ private: } }; + // FIXME Unused code class node { private: unsigned weight; @@ -247,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;