00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef OM_HGUARD_PHRASEPOSTLIST_H
00025 #define OM_HGUARD_PHRASEPOSTLIST_H
00026
00027 #include "selectpostlist.h"
00028 #include <vector>
00029
00030 typedef Xapian::PositionIterator::Internal PositionList;
00031
00039 class NearPostList : public SelectPostList {
00040 private:
00041 Xapian::termpos window;
00042 std::vector<PostList *> terms;
00043
00044 bool test_doc();
00045 bool do_test(std::vector<PositionList *> &plists, Xapian::termcount i,
00046 Xapian::termcount min, Xapian::termcount max);
00047 public:
00048 std::string get_description() const;
00049 Xapian::termcount get_wdf() const;
00050
00051 Xapian::doccount get_termfreq_est() const
00052 {
00053
00054 return source->get_termfreq_est() / 2;
00055 }
00056
00057 NearPostList(PostList *source_, Xapian::termpos window_,
00058 std::vector<PostList *> terms_)
00059 : SelectPostList(source_)
00060 {
00061 window = window_;
00062 terms = terms_;
00063 }
00064 };
00065
00073 class PhrasePostList : public SelectPostList {
00074 private:
00075 Xapian::termpos window;
00076 std::vector<PostList *> terms;
00077
00078 bool test_doc();
00079 bool do_test(std::vector<PositionList *> &plists, Xapian::termcount i,
00080 Xapian::termcount min, Xapian::termcount max);
00081 public:
00082 std::string get_description() const;
00083 Xapian::termcount get_wdf() const;
00084
00085 Xapian::doccount get_termfreq_est() const
00086 {
00087
00088 return source->get_termfreq_est() / 3;
00089 }
00090
00091 PhrasePostList(PostList *source_, Xapian::termpos window_,
00092 std::vector<PostList *> terms_) : SelectPostList(source_)
00093 {
00094 window = window_;
00095 terms = terms_;
00096 }
00097 };
00098
00099 #endif
00100