LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
Lima::LinguisticProcessing::RegexMatching::RegexMatcher Class Reference

This is a MediaProcessUnit that matches regexes against the text itself and replaces corresponding tokens in the analysis graph by one token. More...

#include <linguisticProcessing/core/RegexMatcher/RegexMatcher.h>

Inheritance diagram for Lima::LinguisticProcessing::RegexMatching::RegexMatcher:
Lima::MediaProcessUnit Lima::AbstractProcessUnit< MediaProcessUnit, MediaProcessUnitInitializationParameters > Lima::InitializableObject< Base, InitializationParameters >

Public Member Functions

 RegexMatcher ()
 
virtual ~RegexMatcher ()
 
void init (Common::XMLConfigurationFiles::GroupConfigurationStructure &unitConfiguration, Manager *manager) override
 initialize with parameters from configuration file.
 
LimaStatusCode process (AnalysisContent &analysis) const override
 Process on data in analysisContent.
 
- Public Member Functions inherited from Lima::InitializableObject< Base, InitializationParameters >
 InitializableObject ()
 
 InitializableObject (const InitializableObject &object)
 
InitializableObject & operator= (const InitializableObject &object)
 
virtual ~InitializableObject ()
 
const std::string & getId () const
 get the object id
 
void setId (const std::string &id)
 set the object id
 

Friends

class RegexMatcherPrivate
 

Additional Inherited Members

- Public Types inherited from Lima::InitializableObject< Base, InitializationParameters >
typedef InitializableObjectManager< Base, InitializationParameters > Manager
 Manager is the type of the Manager associated to the initializableObject.
 
typedef InitializableObjectFactory< Base > Factory
 Factory is the type of the Factory associated to the initializableObject.
 
- Protected Attributes inherited from Lima::InitializableObject< Base, InitializationParameters >
std::string m_id
 

Detailed Description

This is a MediaProcessUnit that matches regexes against the text itself and replaces corresponding tokens in the analysis graph by one token.

As a ProcessUnit, it has an init and a process function. See ProcessUnit for details.

IOPES:

  • Input: an AnalysisContent and the following parameters in the configuration file:
    • a map named regexes where each key is a standard regular expression and the value is a tokenization status to associate to created tokens.
  • Output: an AnalysisContent
  • Preconditions: the AnalysisContent must contain an AnalysisData of type AnalysisGraph named "AnalysisGraph". This graph must be a simple string of tokens: each vertex has one and only one next vertex (except for the last one). This is checked.
  • Effects: Tokens matching the regexes are replaced by one token with the given tokenization status and annotations are created in the annotation graph (this one is created if necessary) to match the new vertex with the old ones.

Definition at line 48 of file RegexMatcher.h.

Constructor & Destructor Documentation

◆ RegexMatcher()

Lima::LinguisticProcessing::RegexMatching::RegexMatcher::RegexMatcher ( )

Definition at line 78 of file RegexMatcher.cpp.

◆ ~RegexMatcher()

Lima::LinguisticProcessing::RegexMatching::RegexMatcher::~RegexMatcher ( )
virtual

Definition at line 82 of file RegexMatcher.cpp.

Member Function Documentation

◆ init()

void Lima::LinguisticProcessing::RegexMatching::RegexMatcher::init ( Common::XMLConfigurationFiles::GroupConfigurationStructure &  unitConfiguration,
Manager *  manager 
)
overridevirtual

initialize with parameters from configuration file.

Parameters
unitConfiguration@IN : <group> tag in xml configuration file that contains parameters to initialize the object.
manager@IN : manager that asked for initialization and carries init params Use it to initialize other objects of same kind.
Exceptions
InvalidConfigurationwhen parameters are invalids.

Implements Lima::MediaProcessUnit.

Definition at line 87 of file RegexMatcher.cpp.

◆ process()

LimaStatusCode Lima::LinguisticProcessing::RegexMatching::RegexMatcher::process ( AnalysisContent &  analysis) const
overridevirtual

Process on data in analysisContent.

This method should not return any exception

Parameters
analysisAnalysisContent object on which to process
Exceptions
UndefinedMethodif this method hasn't been specialized

Implements Lima::MediaProcessUnit.

Definition at line 142 of file RegexMatcher.cpp.

Friends And Related Symbol Documentation

◆ RegexMatcherPrivate

friend class RegexMatcherPrivate
friend

Definition at line 50 of file RegexMatcher.h.


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