xapian-core  1.4.30
ortermlist.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2007,2010 Olly Betts
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef XAPIAN_INCLUDED_ORTERMLIST_H
22 #define XAPIAN_INCLUDED_ORTERMLIST_H
23 
24 #include "api/termlist.h"
25 
26 namespace Xapian {
27 namespace Internal {
28 class ExpandStats;
29 }
30 }
31 
32 class OrTermList : public TermList {
33  protected:
36 
44 
46  void check_started() const;
47 
48  public:
49  OrTermList(TermList * left_, TermList * right_)
50  : left(left_), right(right_) { }
51 
52  ~OrTermList();
53 
55 
57 
58  std::string get_termname() const;
59 
60  Xapian::termcount get_wdf() const;
61 
63 
64  TermList *next();
65 
66  TermList * skip_to(const std::string & term);
67 
68  bool at_end() const;
69 
71 
73 };
74 
82  public:
84  : OrTermList(left_, right_)
85  { }
86 
88 };
89 
90 #endif // XAPIAN_INCLUDED_ORTERMLIST_H
A termlist which ORs two termlists together, adding term frequencies.
Definition: ortermlist.h:81
Xapian::doccount get_termfreq() const
Return the term frequency for the term at the current position.
Definition: ortermlist.cc:200
FreqAdderOrTermList(TermList *left_, TermList *right_)
Definition: ortermlist.h:83
Xapian::termcount get_approx_size() const
Return approximate size of this termlist.
Definition: ortermlist.cc:46
TermList * next()
Advance the current position to the next term in the termlist.
Definition: ortermlist.cc:105
std::string right_current
Definition: ortermlist.h:43
std::string get_termname() const
Return the termname at the current position.
Definition: ortermlist.cc:65
void check_started() const
Check that next() has already been called.
Definition: ortermlist.cc:33
TermList * right
Definition: ortermlist.h:35
OrTermList(TermList *left_, TermList *right_)
Definition: ortermlist.h:49
Xapian::doccount get_termfreq() const
Return the term frequency for the term at the current position.
Definition: ortermlist.cc:85
std::string left_current
The current term for left and right respectively.
Definition: ortermlist.h:43
void accumulate_stats(Xapian::Internal::ExpandStats &stats) const
Collate weighting information for the current term.
Definition: ortermlist.cc:56
Xapian::termcount get_wdf() const
Return the wdf for the term at the current position.
Definition: ortermlist.cc:74
Xapian::PositionIterator positionlist_begin() const
Return a PositionIterator for the current position.
Definition: ortermlist.cc:192
TermList * left
The two TermList objects we're merging.
Definition: ortermlist.h:35
bool at_end() const
Return true if the current position is past the last term in this list.
Definition: ortermlist.cc:174
Xapian::termcount positionlist_count() const
Return the length of the position list for the current position.
Definition: ortermlist.cc:185
TermList * skip_to(const std::string &term)
Skip forward to the specified term.
Definition: ortermlist.cc:151
Collates statistics while calculating term weight in an ESet.
Definition: expandweight.h:37
Class for iterating over term positions.
Abstract base class for termlists.
Definition: termlist.h:39
The Xapian namespace contains public interfaces for the Xapian library.
Definition: compactor.cc:80
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:72
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:38
Abstract base class for termlists.