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 
14 
15 namespace meta
16 {
17 namespace index
18 {
19 
37 {
38  public:
40  const static util::string_view id;
41 
43  const static constexpr float default_s = 0.2f;
44 
48  pivoted_length(float s = default_s);
49 
54  pivoted_length(std::istream& in);
55 
59  float score_one(const score_data& sd) override;
60 
61  void save(std::ostream& out) const override;
62 
63  private:
65  const float s_;
66 };
67 
72 template <>
73 std::unique_ptr<ranker> make_ranker<pivoted_length>(const cpptoml::table&);
74 }
75 }
76 #endif
float score_one(const score_data &sd) override
Definition: pivoted_length.cpp:37
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:50
void save(std::ostream &out) const override
Saves the ranker to a stream.
Definition: pivoted_length.cpp:30
Definition: ranker.h:226
A non-owning reference to a string.
Definition: string_view.h:51
static const util::string_view id
Identifier for this ranker.
Definition: pivoted_length.h:40
The ModErn Text Analysis toolkit is a suite of natural language processing, classification, information retrieval, data mining, and other applications of text processing.
Definition: analyzer.h:25
pivoted_length(float s=default_s)
Definition: pivoted_length.cpp:19
The pivoted document length normalization ranking function.
Definition: pivoted_length.h:36
static const constexpr float default_s
Default value of s parameter.
Definition: pivoted_length.h:43
A score_data object contains information needed to evaluate a ranking function.
Definition: score_data.h:40
const float s_
s parameter for pivoted_length normalization
Definition: pivoted_length.h:65