10 #ifndef _STRUS_ANALYZER_PATTERN_SERIALIZE_LIB_HPP_INCLUDED
11 #define _STRUS_ANALYZER_PATTERN_SERIALIZE_LIB_HPP_INCLUDED
19 class PatternTermFeederInterface;
21 class PatternTermFeederInstanceInterface;
23 class PatternLexerInterface;
25 class PatternLexerInstanceInterface;
27 class PatternMatcherInterface;
29 class PatternMatcherInstanceInterface;
31 class ErrorBufferInterface;
33 struct SerializerData;
45 :m_errorhnd(errorhnd_),m_serializerData(serializerData_),m_lexer(lexer_),m_feeder(0),m_matcher(matcher_){}
48 :m_errorhnd(errorhnd_),m_serializerData(serializerData_),m_lexer(0),m_feeder(feeder_),m_matcher(matcher_){}
66 ErrorBufferInterface* m_errorhnd;
67 SerializerData* m_serializerData;
68 PatternLexerInstanceInterface* m_lexer;
69 PatternTermFeederInstanceInterface* m_feeder;
70 PatternMatcherInstanceInterface* m_matcher;
83 const std::string& m_itrcontent,
84 ErrorBufferInterface* errorhnd);
93 const std::string& filename,
95 ErrorBufferInterface* errorhnd);
103 std::ostream& output,
105 ErrorBufferInterface* errorhnd);
113 const std::string& source,
114 PatternLexerInstanceInterface* lexer,
115 PatternMatcherInstanceInterface* matcher,
116 ErrorBufferInterface* errorhnd);
124 const std::string& source,
125 PatternTermFeederInstanceInterface* feeder,
126 PatternMatcherInstanceInterface* matcher,
127 ErrorBufferInterface* errorhnd);
PatternTermFeederInstanceInterface * feeder()
Get the term feeder interface to instantiate or 0, if not defined.
Definition: pattern_serialize.hpp:55
Definition: pattern_serialize.hpp:76
Instance interface for defining a mapping of terms of the document analysis outout as lexems used as ...
Definition: patternTermFeederInstanceInterface.hpp:20
bool isPatternSerializerContent(const std::string &m_itrcontent, ErrorBufferInterface *errorhnd)
Evaluate, if a content is a pattern serialization.
Definition: pattern_serialize.hpp:40
Interface for building the automaton for detecting patterns in text.
Definition: patternMatcherInstanceInterface.hpp:22
~PatternSerializer()
Destructor.
Interface for building the automaton for detecting lexems used as basic entities by pattern matching ...
Definition: patternLexerInstanceInterface.hpp:23
PatternSerializer * createPatternSerializerText(std::ostream &output, const PatternSerializerType &serializerType, ErrorBufferInterface *errorhnd)
Create a serializer of patterns loaded as text to a stream.
PatternSerializer(SerializerData *serializerData_, PatternLexerInstanceInterface *lexer_, PatternMatcherInstanceInterface *matcher_, ErrorBufferInterface *errorhnd_)
Constructor.
Definition: pattern_serialize.hpp:44
PatternSerializerType
Defines different types of pattern matchers to serialize.
Definition: pattern_serialize.hpp:74
PatternSerializer * createPatternSerializer(const std::string &filename, const PatternSerializerType &serializerType, ErrorBufferInterface *errorhnd)
Create a serializer of patterns loaded.
Object with all interfaces needed for serialization.
Definition: pattern_serialize.hpp:37
PatternLexerInstanceInterface * lexer()
Get the lexer interface to instantiate or 0, if not defined.
Definition: pattern_serialize.hpp:53
PatternMatcherInstanceInterface * matcher()
Get the pattern matcher interface to instantiate.
Definition: pattern_serialize.hpp:57
Definition: pattern_serialize.hpp:77
bool loadPatternMatcherFromSerialization(const std::string &source, PatternLexerInstanceInterface *lexer, PatternMatcherInstanceInterface *matcher, ErrorBufferInterface *errorhnd)
Instantiate pattern matching interfaces from serialization.
PatternSerializer(SerializerData *serializerData_, PatternTermFeederInstanceInterface *feeder_, PatternMatcherInstanceInterface *matcher_, ErrorBufferInterface *errorhnd_)
Constructor.
Definition: pattern_serialize.hpp:47