strus  0.17
weightingFunctionContextInterface.hpp
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 http://mozilla.org/MPL/2.0/.
7  */
10 #ifndef _STRUS_WEIGHTING_EXECUTION_CONTEXT_INTERFACE_HPP_INCLUDED
11 #define _STRUS_WEIGHTING_EXECUTION_CONTEXT_INTERFACE_HPP_INCLUDED
12 #include "strus/index.hpp"
13 #include "strus/termStatistics.hpp"
14 #include <string>
15 
16 namespace strus
17 {
19 class MetaDataReaderInterface;
21 class PostingIteratorInterface;
22 
25 {
26 public:
29 
36  virtual void addWeightingFeature(
37  const std::string& name_,
38  PostingIteratorInterface* postingIterator_,
39  double weight_,
40  const TermStatistics& stats_)=0;
41 
45  virtual void setVariableValue( const std::string& name, double value)=0;
46 
50  virtual double call( const Index& docno)=0;
51 
55  virtual std::string debugCall( const Index& docno)=0;
56 };
57 
58 }//namespace
59 #endif
60 
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()
Destructor.
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.