Clarify comment
[xapian.git] / xapian-letor / feature / feature.cc
blobafc7f43aaa5bd2e71b460ad170ca1242a40e8921
1 /** @file feature.cc
2 * @brief Description of Feature class
3 */
4 /* Copyright (C) 2016 Ayush Tomar
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
19 * USA
22 #include <config.h>
24 #include "xapian-letor/feature.h"
25 #include "debuglog.h"
27 namespace Xapian {
29 Feature::Feature() : stats_needed()
31 LOGCALL_CTOR(API, "Feature", NO_ARGS);
34 Feature::~Feature() {
35 LOGCALL_DTOR(API, "Feature");
38 void
39 Feature::set_database(const Xapian::Database & db)
41 LOGCALL_VOID(API, "Feature::set_database", db);
42 feature_db = db;
45 void
46 Feature::set_query(const Xapian::Query & query)
48 LOGCALL_VOID(API, "Feature::set_query", query);
49 feature_query = query;
52 void
53 Feature::set_doc(const Xapian::Document & doc)
55 LOGCALL_VOID(API, "Feature::set_doc", doc);
56 feature_doc = doc;
59 void
60 Feature::set_termfreq(const std::map<std::string, Xapian::termcount> & tf)
62 LOGCALL_VOID(API, "Feature::set_termfreq", tf);
63 termfreq = tf;
66 void
67 Feature::set_inverse_doc_freq(const std::map<std::string, double> & idf)
69 LOGCALL_VOID(API, "Feature::set_inverse_doc_freq", idf);
70 inverse_doc_freq = idf;
73 void
74 Feature::set_doc_length(const std::map<std::string,
75 Xapian::termcount> & doc_len)
77 LOGCALL_VOID(API, "Feature::set_doc_length", doc_len);
78 doc_length = doc_len;
81 void
82 Feature::set_collection_length(const std::map<std::string,
83 Xapian::termcount> & collection_len)
85 LOGCALL_VOID(API, "Feature::set_collection_length", collection_len);
86 collection_length = collection_len;
89 void
90 Feature::set_collection_termfreq(const std::map<std::string,
91 Xapian::termcount> &collection_tf)
93 LOGCALL_VOID(API, "Feature::set_collection_termfreq", collection_tf);
94 collection_termfreq = collection_tf;