Bringing tree up to date.
[galago.git] / cpp / galago / include / BinnedFeatureIndex.hpp
blobd7765c065fdc617543fd05b05955bddc3585c22b
2 //
3 // BinnedFeatureIndex
4 //
5 // 5 January 2007 -- tds
6 //
7 // BSD License (http://galagosearch.org/license)
8 //
10 #ifndef GALAGO_BINNEDFEATUREINDEX_HPP
11 #define GALAGO_BINNEDFEATUREINDEX_HPP
13 #include "indri/Parameters.hpp"
14 #include "BinOrderedBinnedIterator.hpp"
15 #include "Stemmer.hpp"
16 #include "Normalizer.hpp"
17 #include "Query.hpp"
18 #include "Stopper.hpp"
19 #include "IndexReader.hpp"
21 #define BINNEDFEATUREINDEX_MAX_TERM_LENGTH (512)
22 #define BINNEDFEATUREINDEX_VOCAB_GROUP (16)
23 #define BINNEDFEATUREINDEX_BLOCK_SIZE (1<<16)
25 class BinnedFeatureIndex {
26 private:
27 IndexReader _reader;
29 Stemmer* stemmer;
30 Stopper* stopper;
31 Normalizer normalizer;
33 UINT64 _maximumDocumentCount;
34 bool _requiresWeighting;
36 void _build_stemmer();
37 void _build_stopper();
39 public:
40 static const int blockSize = BINNEDFEATUREINDEX_BLOCK_SIZE;
41 static const int vocabGroup = BINNEDFEATUREINDEX_VOCAB_GROUP;
42 static const char maxTermLength = BINNEDFEATUREINDEX_MAX_TERM_LENGTH;
44 public:
45 BinnedFeatureIndex();
46 ~BinnedFeatureIndex();
48 void openRead( const std::string& indexPath );
49 void close();
50 BinOrderedBinnedIterator* getTerm( const std::string& term ) const;
51 QueryTerm processTerm( const QueryTerm& term ) const;
52 UINT64 maximumDocumentCount() const;
53 bool requiresWeighting() const;
56 #endif // GALAGO_BINNEDFEATUREINDEX_HPP