strusAnalyzer  0.17
Public Member Functions | List of all members
strus::PatternTermFeederInstanceInterface Class Referenceabstract

Instance interface for defining a mapping of terms of the document analysis outout as lexems used as basic entities by pattern matching. More...

#include <patternTermFeederInstanceInterface.hpp>

Public Member Functions

virtual ~PatternTermFeederInstanceInterface ()
 Destructor. More...
 
virtual void defineLexem (unsigned int id, const std::string &type)=0
 Define a term type. More...
 
virtual void defineSymbol (unsigned int id, unsigned int lexemid, const std::string &name)=0
 Define a symbol, an instance of a basic lexem, that gets a different id than the basic lexem. More...
 
virtual unsigned int getLexem (const std::string &type) const =0
 Get the value of a defined lexem by type. More...
 
virtual std::vector< std::string > lexemTypes () const =0
 Get the list of lexem types defined. More...
 
virtual unsigned int getSymbol (unsigned int lexemid, const std::string &name) const =0
 Get the identifier of a defined symbol. More...
 
virtual analyzer::FunctionView view () const =0
 Get the definition of the function as structure for introspection. More...
 

Detailed Description

Instance interface for defining a mapping of terms of the document analysis outout as lexems used as basic entities by pattern matching.

Constructor & Destructor Documentation

virtual strus::PatternTermFeederInstanceInterface::~PatternTermFeederInstanceInterface ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual void strus::PatternTermFeederInstanceInterface::defineLexem ( unsigned int  id,
const std::string &  type 
)
pure virtual

Define a term type.

Parameters
[in]ididentifier given to the lexem assiciated with this term type
[in]typeterm type string
Remarks
Because 0 is reserved for undefined values, the id parameter must not be 0
For performance it may be significantly better to define rules without resultIndex selection.
virtual void strus::PatternTermFeederInstanceInterface::defineSymbol ( unsigned int  id,
unsigned int  lexemid,
const std::string &  name 
)
pure virtual

Define a symbol, an instance of a basic lexem, that gets a different id than the basic lexem.

Parameters
[in]ididentifier given to the result substring, 0 if the result term is not appearing in the output
[in]lexemididentifier of the basic lexem this symbol belongs to
[in]namename (value string) of the symbol
virtual unsigned int strus::PatternTermFeederInstanceInterface::getLexem ( const std::string &  type) const
pure virtual

Get the value of a defined lexem by type.

Parameters
[in]typetype name of the lexem
Returns
the lexem identifier or 0, if not defined
virtual unsigned int strus::PatternTermFeederInstanceInterface::getSymbol ( unsigned int  lexemid,
const std::string &  name 
) const
pure virtual

Get the identifier of a defined symbol.

Parameters
[in]lexemididentifier of the basic lexem this symbol belongs to
[in]namename (value string) of the symbol
Returns
the symbol identifier or 0, if not defined
Remarks
this function is needed because symbols are most likely implicitely defined on demand by reference
virtual std::vector<std::string> strus::PatternTermFeederInstanceInterface::lexemTypes ( ) const
pure virtual

Get the list of lexem types defined.

Returns
the list of lexem types
virtual analyzer::FunctionView strus::PatternTermFeederInstanceInterface::view ( ) const
pure virtual

Get the definition of the function as structure for introspection.

Returns
structure for introspection

The documentation for this class was generated from the following file: