strus  0.17
summarizationVariable.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_SUMMARIZATION_VARIABLE_HPP_INCLUDED
11 #define _STRUS_SUMMARIZATION_VARIABLE_HPP_INCLUDED
12 #include "strus/index.hpp"
14 #include <vector>
15 #include <string>
16 
17 namespace strus
18 {
19 
22 {
23 public:
27  SummarizationVariable( const std::string& name_, PostingIteratorInterface* itr_)
28  :m_name(name_),m_itr(itr_){}
32  :m_name(o.m_name),m_itr(o.m_itr){}
33 
35  const std::string& name() const {return m_name;}
38  Index position() const {return m_itr->posno();}
39 
42  const PostingIteratorInterface* itr() const {return m_itr;}
43 
44 private:
45  std::string m_name;
47 };
48 
49 }//namespace
50 #endif
51 
int32_t Index
Number type generally used for locally counted indices.
Definition: index.hpp:29
SummarizationVariable(const std::string &name_, PostingIteratorInterface *itr_)
Constructor.
Definition: summarizationVariable.hpp:27
Numeric types used for local and global indices.
Interface for an iterator on postings (pairs of (d,p) where d is the document number and p the positi...
virtual Index posno() const =0
Get the current position number.
SummarizationVariable(const SummarizationVariable &o)
Copy constructor.
Definition: summarizationVariable.hpp:31
Structure that represents a set of feature occurrencies (postings) as iterator.
Definition: postingIteratorInterface.hpp:20
const std::string & name() const
Name of the variable.
Definition: summarizationVariable.hpp:35
Index position() const
Feature occurrence attached to this variable at the current position of the summarizer feature postin...
Definition: summarizationVariable.hpp:38
const PostingIteratorInterface * itr() const
Posting iterator of the variable.
Definition: summarizationVariable.hpp:42
Structure describing a variable referencing a named match of a subexpression. Variables are attached ...
Definition: summarizationVariable.hpp:21