strusAnalyzer  0.17
segmenterOptions.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_ANALYZER_SEGMENTER_OPTIONS_HPP_INCLUDED
11 #define _STRUS_ANALYZER_SEGMENTER_OPTIONS_HPP_INCLUDED
12 #include <vector>
13 #include <string>
14 #include <utility>
15 
17 namespace strus {
18 namespace analyzer {
19 
26 {
27 public:
30  :m_optar(0){}
32 #if __cplusplus >= 201103L
33  SegmenterOptions( SegmenterOptions&& ) = default;
34  SegmenterOptions( const SegmenterOptions& ) = default;
35  SegmenterOptions& operator= ( SegmenterOptions&& ) = default;
36  SegmenterOptions& operator= ( const SegmenterOptions& ) = default;
37 #else
39  :m_optar(o.m_optar){}
40 #endif
41 
43  typedef std::pair<std::string,std::string> Item;
44 
49  SegmenterOptions& operator()( const std::string& name, const std::string& value)
50  {
51  m_optar.push_back( Item( name, value));
52  return *this;
53  }
54 
57  const std::vector<Item>& items() const
58  {
59  return m_optar;
60  }
61 
62 private:
63  std::vector<Item> m_optar;
64 };
65 
66 }}//namespace
67 #endif
68 
69 
SegmenterOptions()
Default constructor.
Definition: segmenterOptions.hpp:29
Options to stear the segmenter behaviour or the structure of input if not self defined in the documen...
Definition: segmenterOptions.hpp:25
std::pair< std::string, std::string > Item
One option item. Interpretation depends on the segmenter implementation.
Definition: segmenterOptions.hpp:43
SegmenterOptions & operator()(const std::string &name, const std::string &value)
Define a new option.
Definition: segmenterOptions.hpp:49
SegmenterOptions(const SegmenterOptions &o)
Copy constructor.
Definition: segmenterOptions.hpp:38
const std::vector< Item > & items() const
Get the list of all declared option items.
Definition: segmenterOptions.hpp:57