strus  0.17
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Patrick P. Frey
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at
7  */
12 #include "strus/index.hpp"
13 #include "strus/termStatistics.hpp"
14 #include <string>
16 namespace strus
17 {
19 class MetaDataReaderInterface;
21 class PostingIteratorInterface;
25 {
26 public:
36  virtual void addWeightingFeature(
37  const std::string& name_,
38  PostingIteratorInterface* postingIterator_,
39  double weight_,
40  const TermStatistics& stats_)=0;
45  virtual void setVariableValue( const std::string& name, double value)=0;
50  virtual double call( const Index& docno)=0;
55  virtual std::string debugCall( const Index& docno)=0;
56 };
58 }//namespace
59 #endif
int32_t Index
Number type generally used for locally counted indices.
Definition: index.hpp:29
virtual void addWeightingFeature(const std::string &name_, PostingIteratorInterface *postingIterator_, double weight_, const TermStatistics &stats_)=0
Add a feature that is subject of weighting to the execution context.
Numeric types used for local and global indices.
Interface for a weighting function with its state and context used during calculation.
Definition: weightingFunctionContextInterface.hpp:24
Structure that represents a set of feature occurrencies (postings) as iterator.
Definition: postingIteratorInterface.hpp:20
virtual void setVariableValue(const std::string &name, double value)=0
Set the value of a query variable.
virtual double call(const Index &docno)=0
Call the weighting function for a document.
Global term statistics, if passed down with the query.
Definition: termStatistics.hpp:16
virtual ~WeightingFunctionContextInterface()
Definition: weightingFunctionContextInterface.hpp:28
virtual std::string debugCall(const Index &docno)=0
Get debug info dumped as string of the weighting call for one document.