strusAnalyzer  0.17
queryAnalyzerInstanceInterface.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_QUERY_ANALYZER_INTERFACE_HPP_INCLUDED
11 #define _STRUS_ANALYZER_QUERY_ANALYZER_INTERFACE_HPP_INCLUDED
15 #include <vector>
16 #include <string>
17 
19 namespace strus
20 {
22 class QueryAnalyzerContextInterface;
24 class PatternTermFeederInstanceInterface;
26 class PatternMatcherInstanceInterface;
28 class PatternLexerInstanceInterface;
29 
32 {
33 public:
36 
43  virtual void addElement(
44  const std::string& termtype,
45  const std::string& fieldtype,
47  const std::vector<NormalizerFunctionInstanceInterface*>& normalizers,
48  int priority)=0;
49 
56  virtual void addPatternLexem(
57  const std::string& termtype,
58  const std::string& fieldtype,
60  const std::vector<NormalizerFunctionInstanceInterface*>& normalizers,
61  int priority)=0;
62 
67  virtual void defineTokenPatternMatcher(
68  const std::string& patternTypeName,
71 
77  virtual void defineContentPatternMatcher(
78  const std::string& patternTypeName,
81  const std::vector<std::string>& selectexpr)=0;
82 
89  virtual void addElementFromPatternMatch(
90  const std::string& type,
91  const std::string& patternTypeName,
92  const std::vector<NormalizerFunctionInstanceInterface*>& normalizers,
93  int priority)=0;
94 
97  virtual std::vector<std::string> queryTermTypes() const=0;
98 
101  virtual std::vector<std::string> queryFieldTypes() const=0;
102 
105  virtual QueryAnalyzerContextInterface* createContext() const=0;
106 
109  virtual analyzer::QueryAnalyzerView view() const=0;
110 };
111 
112 }//namespace
113 #endif
114 
Structure describing the internal representation of a document analyzer for introspection.
Definition: queryAnalyzerView.hpp:22
Instance interface for defining a mapping of terms of the document analysis outout as lexems used as ...
Definition: patternTermFeederInstanceInterface.hpp:20
virtual void defineTokenPatternMatcher(const std::string &patternTypeName, PatternMatcherInstanceInterface *matcher, PatternTermFeederInstanceInterface *feeder)=0
Declare a pattern matcher on the tokens after normalization (pattern lexems and query features) ...
virtual QueryAnalyzerContextInterface * createContext() const =0
Create the context used for analyzing a query.
virtual void addElement(const std::string &termtype, const std::string &fieldtype, TokenizerFunctionInstanceInterface *tokenizer, const std::vector< NormalizerFunctionInstanceInterface * > &normalizers, int priority)=0
Declare an element to be retrieved from the search index.
Interface for a parameterized normalizer function.
virtual std::vector< std::string > queryTermTypes() const =0
Get the query term types declared in order of appearance in declarations return the query field types...
Interface for building the automaton for detecting patterns in text.
Definition: patternMatcherInstanceInterface.hpp:22
virtual void addPatternLexem(const std::string &termtype, const std::string &fieldtype, TokenizerFunctionInstanceInterface *tokenizer, const std::vector< NormalizerFunctionInstanceInterface * > &normalizers, int priority)=0
Declare an element to be used as lexem by post processing pattern matching but not put into the resul...
Interface for building the automaton for detecting lexems used as basic entities by pattern matching ...
Definition: patternLexerInstanceInterface.hpp:23
virtual void addElementFromPatternMatch(const std::string &type, const std::string &patternTypeName, const std::vector< NormalizerFunctionInstanceInterface * > &normalizers, int priority)=0
Declare a feature to be searched for derived from a pattern matcher result item.
Interface for tokenization.
Definition: tokenizerFunctionInstanceInterface.hpp:21
virtual void defineContentPatternMatcher(const std::string &patternTypeName, PatternMatcherInstanceInterface *matcher, PatternLexerInstanceInterface *lexer, const std::vector< std::string > &selectexpr)=0
Declare a pattern matcher on the content.
Defines the context for analyzing queries for the strus IR engine.
Definition: queryAnalyzerContextInterface.hpp:21
Defines a program for analyzing chunks of a query.
Definition: queryAnalyzerInstanceInterface.hpp:31
virtual std::vector< std::string > queryFieldTypes() const =0
Get the query field types declared in order of appearance in declarations return the query field type...
virtual analyzer::QueryAnalyzerView view() const =0
Return a structure with all definitions for introspection.
Structure describing the internal representation of a document analyzer for introspection.
Interface for a parameterized tokenizer function.
virtual ~QueryAnalyzerInstanceInterface()
Destructor.
Definition: queryAnalyzerInstanceInterface.hpp:35