strusAnalyzer  0.17
featureView.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  */
11 #ifndef _STRUS_ANALYZER_DOCUMENT_FEATURE_VIEW_HPP_INCLUDED
12 #define _STRUS_ANALYZER_DOCUMENT_FEATURE_VIEW_HPP_INCLUDED
15 
17 namespace strus {
19 namespace analyzer {
20 
24 {
25 public:
30  :m_type(o.m_type),m_selectexpr(o.m_selectexpr),m_tokenizer(o.m_tokenizer),m_normalizer(o.m_normalizer),m_options(o.m_options),m_priority(o.m_priority){}
31 
39  FeatureView( const std::string& type_, const std::string& selectexpr_, const FunctionView& tokenizer_, const std::vector<FunctionView>& normalizer_, const FeatureOptions& options_, int priority_)
40  :m_type(type_),m_selectexpr(selectexpr_),m_tokenizer(tokenizer_),m_normalizer(normalizer_),m_options(options_),m_priority(priority_){}
41 
43  const std::string& type() const {return m_type;}
45  const std::string& selectexpr() const {return m_selectexpr;}
47  const FunctionView& tokenizer() const {return m_tokenizer;}
49  const std::vector<FunctionView>& normalizer() const {return m_normalizer;}
51  const FeatureOptions& options() const {return m_options;}
53  int priority() const {return m_priority;}
54 
56  const char* posbindOption() const
57  {
58  static const char* ar[] = {"content","succ","pred","unique"};
59  return ar[ (int)m_options.positionBind()];
60  }
61 
62 private:
63  std::string m_type;
64  std::string m_selectexpr;
65  FunctionView m_tokenizer;
66  std::vector<FunctionView> m_normalizer;
67  FeatureOptions m_options;
68  int m_priority;
69 };
70 
71 }}//namespace
72 #endif
73 
const FeatureOptions & options() const
Get the options.
Definition: featureView.hpp:51
Options to stear the creation of terms in the analyzer.
Definition: featureOptions.hpp:21
Options to stear the position assignment of features.
int priority() const
Get the priority of the feature.
Definition: featureView.hpp:53
FeatureView(const FeatureView &o)
Copy constructor.
Definition: featureView.hpp:29
Structure describing the internal representation of a normalizer/tokenizer/aggregator function in the...
const std::vector< FunctionView > & normalizer() const
Get the list of normalizers.
Definition: featureView.hpp:49
Structure describing the internal representation of a normalizer/tokenizer/aggregator function in the...
Definition: functionView.hpp:29
FeatureView(const std::string &type_, const std::string &selectexpr_, const FunctionView &tokenizer_, const std::vector< FunctionView > &normalizer_, const FeatureOptions &options_, int priority_)
Constructor.
Definition: featureView.hpp:39
const std::string & selectexpr() const
Get the segmenter selection expression.
Definition: featureView.hpp:45
const char * posbindOption() const
Get position bind option.
Definition: featureView.hpp:56
const FunctionView & tokenizer() const
Get the tokenizer.
Definition: featureView.hpp:47
FeatureView()
Default constructor.
Definition: featureView.hpp:27
analyzer::PositionBind positionBind() const
Get the PositionBind value set.
Definition: featureOptions.hpp:42
const std::string & type() const
Get the type.
Definition: featureView.hpp:43
Structure describing the internal representation of a feature in the document analyzer.
Definition: featureView.hpp:23