Lucene++ - a full-featured, c++ search engine
API Documentation


SloppyPhraseScorer.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3 // Distributable under the terms of either the Apache License (Version 2.0)
4 // or the GNU Lesser General Public License.
6 
7 #ifndef SLOPPYPHRASESCORER_H
8 #define SLOPPYPHRASESCORER_H
9 
10 #include "PhraseScorer.h"
11 
12 namespace Lucene {
13 
15 public:
18 
20 
21 protected:
22  int32_t slop;
24  Collection<PhrasePositionsPtr> tmpPos; // for flipping repeating pps
26 
27 public:
40  virtual double phraseFreq();
41 
42 protected:
46 
59 
65 };
66 
67 }
68 
69 #endif
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Utility template class to handle collections that can be safely copied and shared.
Definition: Collection.h:17
Scoring functionality for phrase queries. A document is considered matching if it contains the phrase...
Definition: PhraseScorer.h:21
ByteArray norms
Definition: PhraseScorer.h:30
WeightPtr weight
Definition: PhraseScorer.h:26
SimilarityPtr similarity
Definition: Scorer.h:45
Definition: SloppyPhraseScorer.h:14
int32_t initPhrasePositions()
Init PhrasePositions in place. There is a one time initialization for this scorer:
SloppyPhraseScorer(const WeightPtr &weight, Collection< TermPositionsPtr > tps, Collection< int32_t > offsets, const SimilarityPtr &similarity, int32_t slop, ByteArray norms)
int32_t slop
Definition: SloppyPhraseScorer.h:19
virtual double phraseFreq()
Score a candidate doc for all slop-valid position-combinations (matches) encountered while traversing...
Collection< PhrasePositionsPtr > tmpPos
Definition: SloppyPhraseScorer.h:24
bool checkedRepeats
Definition: SloppyPhraseScorer.h:25
PhrasePositionsPtr flip(const PhrasePositionsPtr &pp, const PhrasePositionsPtr &pp2)
Flip pp2 and pp in the queue: pop until finding pp2, insert back all but pp2, insert pp back....
PhrasePositionsPtr termPositionsDiffer(const PhrasePositionsPtr &pp)
We disallow two pp's to have the same TermPosition, thereby verifying multiple occurrences in the que...
Collection< PhrasePositionsPtr > repeats
Definition: SloppyPhraseScorer.h:23
Definition: AbstractAllTermDocs.h:12
boost::shared_ptr< PhrasePositions > PhrasePositionsPtr
Definition: LuceneTypes.h:410
boost::shared_ptr< Similarity > SimilarityPtr
Definition: LuceneTypes.h:435
boost::shared_ptr< Weight > WeightPtr
Definition: LuceneTypes.h:480

clucene.sourceforge.net