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

This is a MediaProcessUnit that is usually the first element of the pipeline. More...

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

Inheritance diagram for Lima::LinguisticProcessing::LDetector::LangDetector:
Lima::MediaProcessUnit Lima::AbstractProcessUnit< MediaProcessUnit, MediaProcessUnitInitializationParameters > Lima::InitializableObject< Base, InitializationParameters >

Public Member Functions

 LangDetector ()
 
virtual ~LangDetector ()
 
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
 

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 is usually the first element of the pipeline.

It cuts the input text into tokens

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:
    • charChart: the name of a group in the Resources module. This defines a resource of class FlatTokenizerCharChart with a parameter named charFile given the path to the chars chart file to use, relative to the main resources folder
    • automatonFile: the path to the tokenization automaton file to use, relative to the main resources folder
  • Output: an AnalysisContent
  • Preconditions: the AnalysisContent must contain an AnalysisData of type LimaStringText named "Text"
  • Effects: the AnalysisContent will contain an AnalysisData of type AnalysisGraph named "AnalysisGraph" which is a linear graph (a string) containing one vertex for each detected token.

Definition at line 33 of file LangDetector.h.

Constructor & Destructor Documentation

◆ LangDetector()

Lima::LinguisticProcessing::LDetector::LangDetector::LangDetector ( )

Definition at line 20 of file LangDetector.cpp.

◆ ~LangDetector()

Lima::LinguisticProcessing::LDetector::LangDetector::~LangDetector ( )
virtual

Definition at line 25 of file LangDetector.cpp.

Member Function Documentation

◆ init()

void Lima::LinguisticProcessing::LDetector::LangDetector::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 31 of file LangDetector.cpp.

◆ process()

LimaStatusCode Lima::LinguisticProcessing::LDetector::LangDetector::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 39 of file LangDetector.cpp.


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