10 #ifndef _STRUS_ANALYZER_PATTERN_MATCHER_INSTANCE_INTERFACE_HPP_INCLUDED
11 #define _STRUS_ANALYZER_PATTERN_MATCHER_INSTANCE_INTERFACE_HPP_INCLUDED
19 class PatternMatcherContextInterface;
31 virtual void defineOption(
const std::string& name,
double value)=0;
40 virtual void pushTerm(
unsigned int termid)=0;
55 static const char* ar[] = {
"sequence",
"sequence_imm",
"sequence_struct",
"within",
"within_struct",
"any",
"and",0};
67 std::size_t argc,
unsigned int range,
unsigned int cardinality)=0;
71 virtual void pushPattern(
const std::string& name)=0;
85 virtual void definePattern(
const std::string& name,
const std::string& formatstring,
bool visible)=0;
At least one of the argument patterns must appear for the completion of the rule. ...
Definition: patternMatcherInstanceInterface.hpp:50
JoinOperation
Join operations (similar meaning as in query evaluation)
Definition: patternMatcherInstanceInterface.hpp:43
Structure describing the internal representation of a normalizer/tokenizer/aggregator function in the...
Interface for building the automaton for detecting patterns in text.
Definition: patternMatcherInstanceInterface.hpp:22
virtual void defineTermFrequency(unsigned int termid, double df)=0
Define a relative document term frequency used for optimization of the automaton. ...
The argument patterns must appear in the specified (strict) order (ordinal span) within a specified p...
Definition: patternMatcherInstanceInterface.hpp:45
Structure describing the internal representation of a normalizer/tokenizer/aggregator function in the...
Definition: functionView.hpp:29
static const char * joinOperationName(JoinOperation op)
Definition: patternMatcherInstanceInterface.hpp:53
The argument patterns must appear within a specified proximity range of ordinal positions without ove...
Definition: patternMatcherInstanceInterface.hpp:48
virtual void definePattern(const std::string &name, const std::string &formatstring, bool visible)=0
Create a pattern that can be referenced by the given name and can be declared as part of the result...
The argument patterns must appear within a specified proximity range of ordinal positions without ove...
Definition: patternMatcherInstanceInterface.hpp:49
virtual PatternMatcherContextInterface * createContext() const =0
Create the context to process a document with the pattern matcher.
All of the argument patterns must appear for the completion of the rule at the same ordinal position...
Definition: patternMatcherInstanceInterface.hpp:51
virtual void pushExpression(JoinOperation operation, std::size_t argc, unsigned int range, unsigned int cardinality)=0
Take the topmost elements from the stack, build an expression out of them and replace the argument el...
The argument patterns must appear in the specified (strict) order (ordinal span) within a specified p...
Definition: patternMatcherInstanceInterface.hpp:47
virtual void defineOption(const std::string &name, double value)=0
Define an option value for the compilation.
Same as OpSequence, but does not allow any gap in between the elements.
Definition: patternMatcherInstanceInterface.hpp:46
virtual ~PatternMatcherInstanceInterface()
Destructor.
Definition: patternMatcherInstanceInterface.hpp:26
Interface for detecting patterns (structures formed by atomic tokens) in one document.
Definition: patternMatcherContextInterface.hpp:21
virtual analyzer::FunctionView view() const =0
Get the definition of the function as structure for introspection.
virtual void pushTerm(unsigned int termid)=0
Push a term on the stack.
virtual void pushPattern(const std::string &name)=0
Push a reference to a pattern on the stack.
virtual void attachVariable(const std::string &name)=0
Attaches a variable to the top expression or term on the stack.
virtual bool compile()=0
Compile all patterns defined.