strusModule  0.17
analyzerModule.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_MODULE_ANALYZER_HPP_INCLUDED
11 #define _STRUS_MODULE_ANALYZER_HPP_INCLUDED
13 #include <string>
14 
16 namespace strus
17 {
18 
20 class DocumentClassDetectorInterface;
22 class SegmenterInterface;
24 class TokenizerFunctionInterface;
26 class NormalizerFunctionInterface;
28 class AggregatorFunctionInterface;
30 class PatternLexerInterface;
32 class PatternMatcherInterface;
34 class ErrorBufferInterface;
35 
38 {
39  typedef const DocumentClassDetectorInterface* (*Create)( ErrorBufferInterface* errorhnd);
40  const char* title;
42 };
43 
46 {
47  typedef SegmenterInterface* (*Create)( ErrorBufferInterface* errorhnd);
48  const char* name;
50 };
51 
54 {
55  typedef TokenizerFunctionInterface* (*Create)( ErrorBufferInterface* errorhnd);
56  const char* name;
58 };
59 
62 {
63  typedef NormalizerFunctionInterface* (*Create)( ErrorBufferInterface* errorhnd);
64  const char* name;
66 };
67 
70 {
71  typedef AggregatorFunctionInterface* (*Create)( ErrorBufferInterface* errorhnd);
72  const char* name;
74 };
75 
78 {
79  typedef PatternLexerInterface* (*Create)( ErrorBufferInterface* errorhnd);
80  const char* name;
82 };
83 
86 {
87  typedef PatternMatcherInterface* (*Create)( ErrorBufferInterface* errorhnd);
88  const char* name;
90 };
91 
94  :public ModuleEntryPoint
95 {
100  const DocumentClassDetectorConstructor& documentClassDetectorConstructor_,
101  const SegmenterConstructor& segmenterConstructor_);
102 
106  const SegmenterConstructor& segmenterConstructor_);
107 
113  const TokenizerConstructor* tokenizerConstructors_,
114  const NormalizerConstructor* normalizerConstructors_,
115  const AggregatorConstructor* aggregatorConstructors_);
116 
119  const PatternLexerConstructor& patternLexerConstructor_,
120  const PatternMatcherConstructor& patternMatcherConstructor_);
121 
124  const PatternLexerConstructor& patternLexerConstructor_,
125  const PatternMatcherConstructor& patternMatcherConstructor_,
126  const char* version_3rdparty, const char* license_3rdparty);
127 
135 
136 private:
137  void init(
138  const DocumentClassDetectorConstructor* documentClassDetectorConstructor_,
139  const SegmenterConstructor* segmenterConstructor_,
140  const TokenizerConstructor* tokenizerConstructors_,
141  const NormalizerConstructor* normalizerConstructors_,
142  const AggregatorConstructor* aggregatorConstructors_,
143  const PatternLexerConstructor* patternLexerConstructor_,
144  const PatternMatcherConstructor* patternMatcherConstructor_);
145 };
146 }//namespace
147 #endif
148 
AggregatorFunctionInterface *(* Create)(ErrorBufferInterface *errorhnd)
Definition: analyzerModule.hpp:71
AnalyzerModule(const DocumentClassDetectorConstructor &documentClassDetectorConstructor_, const SegmenterConstructor &segmenterConstructor_)
Analyzer module constructor.
Create create
constructor
Definition: analyzerModule.hpp:73
const char * name
name of the normalizer
Definition: analyzerModule.hpp:64
Structure to define a content detector for an alternative document format.
Definition: analyzerModule.hpp:37
Create create
constructor
Definition: analyzerModule.hpp:57
Entry point of a module with signature and version info to verify correctness of the dynamic linking...
Definition: moduleEntryPoint.hpp:19
Structure to define a proprietary normalizer of tokens as module.
Definition: analyzerModule.hpp:61
Structure to define the lexer for pattern matching the analyzer may refer to.
Definition: analyzerModule.hpp:77
Create create
constructor
Definition: analyzerModule.hpp:89
Create create
constructor
Definition: analyzerModule.hpp:49
const AggregatorConstructor * aggregatorConstructors
0 terminated list of aggregators
Definition: analyzerModule.hpp:132
const DocumentClassDetectorInterface *(* Create)(ErrorBufferInterface *errorhnd)
Definition: analyzerModule.hpp:39
PatternMatcherInterface *(* Create)(ErrorBufferInterface *errorhnd)
Definition: analyzerModule.hpp:87
const char * name
name of the tokenizer
Definition: analyzerModule.hpp:56
const TokenizerConstructor * tokenizerConstructors
0 terminated list of tokenizers
Definition: analyzerModule.hpp:130
const NormalizerConstructor * normalizerConstructors
0 terminated list of normalizers
Definition: analyzerModule.hpp:131
const char * version_3rdparty
3rd party version info
Definition: moduleEntryPoint.hpp:46
SegmenterConstructor segmenterConstructor
a segmenter definition
Definition: analyzerModule.hpp:129
PatternMatcherConstructor patternMatcherConstructor
a pattern matcher definition
Definition: analyzerModule.hpp:134
Create create
constructor
Definition: analyzerModule.hpp:41
const char * license_3rdparty
3rd party license text
Definition: moduleEntryPoint.hpp:47
PatternLexerConstructor patternLexerConstructor
a pattern lexer definition
Definition: analyzerModule.hpp:133
PatternLexerInterface *(* Create)(ErrorBufferInterface *errorhnd)
Definition: analyzerModule.hpp:79
const char * name
name of the pattern matcher
Definition: analyzerModule.hpp:88
const char * name
name of the aggregator
Definition: analyzerModule.hpp:72
Create create
constructor
Definition: analyzerModule.hpp:81
Structure to define a proprietary tokenizer of text segments as module.
Definition: analyzerModule.hpp:53
Structure to define the lexer for pattern matching the analyzer may refer to.
Definition: analyzerModule.hpp:85
Structure to define a segmenter for an alternative document format (like XML) as module.
Definition: analyzerModule.hpp:45
const char * title
title of the detector (informal name)
Definition: analyzerModule.hpp:40
Structure that contains all analyzer module objects.
Definition: analyzerModule.hpp:93
SegmenterInterface *(* Create)(ErrorBufferInterface *errorhnd)
Definition: analyzerModule.hpp:47
Structure to define a proprietary function to aggregate a value for a document as meta data (counting...
Definition: analyzerModule.hpp:69
DocumentClassDetectorConstructor documentClassDetectorConstructor
a content detector definition
Definition: analyzerModule.hpp:128
TokenizerFunctionInterface *(* Create)(ErrorBufferInterface *errorhnd)
Definition: analyzerModule.hpp:55
Header with object types needed for declaration of a strus module.
const char * name
name of the segmenter
Definition: analyzerModule.hpp:48
Create create
constructor
Definition: analyzerModule.hpp:65
NormalizerFunctionInterface *(* Create)(ErrorBufferInterface *errorhnd)
Definition: analyzerModule.hpp:63
const char * name
name of the pattern lexer
Definition: analyzerModule.hpp:80