ModErn Text Analysis
META Enumerates Textual Applications
pivoted_length.h
Go to the documentation of this file.
1 
9 #ifndef META_PIVOTED_LENGTH_H_
10 #define META_PIVOTED_LENGTH_H_
11 
12 #include "index/ranker/ranker.h"
14 
15 namespace meta
16 {
17 namespace index
18 {
19 
25 class pivoted_length : public ranker
26 {
27  public:
29  const static std::string id;
30 
32  const static constexpr double default_s = 0.20;
33 
37  pivoted_length(double s = default_s);
38 
42  double score_one(const score_data& sd) override;
43 
44  private:
46  const double s_;
47 };
48 
53 template <>
54 std::unique_ptr<ranker> make_ranker<pivoted_length>(const cpptoml::table&);
55 }
56 }
57 #endif
std::unique_ptr< ranker > make_ranker< pivoted_length >(const cpptoml::table &)
Specialization of the factory method used to create pivoted_length rankers.
Definition: pivoted_length.cpp:34
A ranker scores a query against all the documents in an inverted index, returning a list of documents...
Definition: ranker.h:41
double score_one(const score_data &sd) override
Definition: pivoted_length.cpp:22
static const std::string id
Identifier for this ranker.
Definition: pivoted_length.h:29
The ModErn Text Analysis toolkit is a suite of natural language processing, classification, information retreival, data mining, and other applications of text processing.
Definition: analyzer.h:24
const double s_
s parameter for pivoted_length normalization
Definition: pivoted_length.h:46
The pivoted document length normalization ranking function.
Definition: pivoted_length.h:25
A score_data object contains information needed to evaluate a ranking function.
Definition: score_data.h:39
static const constexpr double default_s
Default value of s parameter.
Definition: pivoted_length.h:32
pivoted_length(double s=default_s)
Definition: pivoted_length.cpp:17