strusAnalyzer  0.17
contentStatisticsItem.hpp
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2018 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_ANALYZER_CONTENT_STATISTICS_ITEM_HPP_INCLUDED
11 #define _STRUS_ANALYZER_CONTENT_STATISTICS_ITEM_HPP_INCLUDED
12 #include <string>
13 
15 namespace strus {
16 namespace analyzer {
17 
20 {
21 public:
22  ContentStatisticsItem( const std::string& select_, const std::string& type_, const std::string& example_, int df_, int tf_)
23  :m_select(select_),m_type(type_),m_example(example_),m_df(df_),m_tf(tf_){}
24 #if __cplusplus >= 201103L
26  ContentStatisticsItem( const ContentStatisticsItem& ) = default;
27  ContentStatisticsItem& operator= ( ContentStatisticsItem&& ) = default;
28  ContentStatisticsItem& operator= ( const ContentStatisticsItem& ) = default;
29 #else
31  :m_select(o.m_select),m_type(o.m_type),m_example(o.m_example),m_df(o.m_df),m_tf(o.m_tf){}
32 #endif
33 
35  const std::string& select() const {return m_select;}
37  const std::string& type() const {return m_type;}
39  const std::string& example() const {return m_example;}
41  int df() const {return m_df;}
43  int tf() const {return m_tf;}
44 
45  void setExample( const std::string& value) {m_example = value;}
46  void setType( const std::string& type_) {m_type = type_;}
47  void incr_df( int df_) {m_df+=df_;}
48  void incr_tf( int tf_) {m_tf+=tf_;}
49 
50 private:
51  std::string m_select;
52  std::string m_type;
53  std::string m_example;
54  int m_df;
55  int m_tf;
56 };
57 
58 }}//namespace
59 #endif
60 
void setType(const std::string &type_)
Definition: contentStatisticsItem.hpp:46
const std::string & type() const
Get the type assigned to it.
Definition: contentStatisticsItem.hpp:37
Defines an item describing the statistics in a collection.
Definition: contentStatisticsItem.hpp:19
ContentStatisticsItem(const std::string &select_, const std::string &type_, const std::string &example_, int df_, int tf_)
Definition: contentStatisticsItem.hpp:22
const std::string & example() const
Get an example that led to this item.
Definition: contentStatisticsItem.hpp:39
const std::string & select() const
Get the select expression.
Definition: contentStatisticsItem.hpp:35
int tf() const
Get the number of appearances in the collection this item appears in.
Definition: contentStatisticsItem.hpp:43
int df() const
Get the number of documents in the collection this item appears in.
Definition: contentStatisticsItem.hpp:41
ContentStatisticsItem(const ContentStatisticsItem &o)
Definition: contentStatisticsItem.hpp:30
void incr_df(int df_)
Definition: contentStatisticsItem.hpp:47
void setExample(const std::string &value)
Definition: contentStatisticsItem.hpp:45
void incr_tf(int tf_)
Definition: contentStatisticsItem.hpp:48