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

LTRTextHandler is a handler for LTR text that gives access to the resulting LTRText through an accessor. More...

#include <linguisticProcessing/client/AnalysisHandlers/LTRTextHandler.h>

Inheritance diagram for Lima::LinguisticProcessing::LTRTextHandler:
Lima::AbstractTextualAnalysisHandler Lima::LinguisticProcessing::AbstractResource Lima::AbstractXmlAnalysisHandler Lima::LinguisticProcessing::AbstractResourceBase Lima::InitializableObject< AbstractResource, ResourceInitializationParameters > Lima::AbstractAnalysisHandler Lima::AnalysisData

Public Member Functions

 LTRTextHandler ()
 
virtual ~LTRTextHandler ()
 
virtual void endAnalysis () override
 function called by the LIMA analyzer on the end of a text part that is to be analyzed
 
virtual void handle (const char *buf, int length) override
 gives content.
 
virtual void startAnalysis () override
 function called by the LIMA analyzer on start of a new document
 
void startDocument (const Common::Misc::GenericDocumentProperties &) override
 notify the start of a new document, and give its properties
 
void endDocument () override
 notify the end of the document
 
void startNode (const std::string &elementName, bool forIndexing) override
 notify the start of a new hierarchyNode
 
void endNode (const Common::Misc::GenericDocumentProperties &props) override
 notify the end of a hierarchyNode
 
Common::BagOfWords::LTR_Text & getLTRText ()
 
virtual void setOut (std::ostream *) override
 set the output stream.
 
- Public Member Functions inherited from Lima::AbstractTextualAnalysisHandler
 AbstractTextualAnalysisHandler ()
 
virtual ~AbstractTextualAnalysisHandler ()
 
virtual void init (Common::XMLConfigurationFiles::GroupConfigurationStructure &unitConfiguration, Manager *manager) override
 initialize with parameters from configuration file.
 
virtual const std::string & suffix () const
 
virtual void setSuffix (const std::string &suffix)
 
- Public Member Functions inherited from Lima::LinguisticProcessing::AbstractResource
 AbstractResource (QObject *parent=0)
 
virtual ~AbstractResource ()
 
 AbstractResource (const AbstractResource &)
 
virtual void init (Common::XMLConfigurationFiles::GroupConfigurationStructure &unitConfiguration, Manager *manager) override=0
 initialize with parameters from configuration file.
 
- Public Member Functions inherited from Lima::LinguisticProcessing::AbstractResourceBase
 AbstractResourceBase (QObject *parent=0)
 
virtual ~AbstractResourceBase ()
 
 AbstractResourceBase (const AbstractResourceBase &)
 
QString getResourceFileName (const QString &paramName)
 
- Public Member Functions inherited from Lima::InitializableObject< AbstractResource, ResourceInitializationParameters >
 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
 
- Public Member Functions inherited from Lima::AbstractXmlAnalysisHandler
 AbstractXmlAnalysisHandler (std::shared_ptr< const ShiftFrom > shiftFrom)
 
virtual ~AbstractXmlAnalysisHandler ()
 
std::shared_ptr< const ShiftFrom > shiftFrom () const
 
- Public Member Functions inherited from Lima::AbstractAnalysisHandler
virtual ~AbstractAnalysisHandler ()
 
- Public Member Functions inherited from Lima::AnalysisData
virtual ~AnalysisData ()
 

Additional Inherited Members

- Public Types inherited from Lima::InitializableObject< AbstractResource, ResourceInitializationParameters >
typedef InitializableObjectManager< AbstractResource, ResourceInitializationParameters > Manager
 Manager is the type of the Manager associated to the initializableObject.
 
typedef InitializableObjectFactory< AbstractResource > Factory
 Factory is the type of the Factory associated to the initializableObject.
 
- Signals inherited from Lima::LinguisticProcessing::AbstractResourceBase
void resourceFileChanged (const QString &path)
 Signal triggered whenever one of the registered files changes on disk.
 
- Protected Member Functions inherited from Lima::LinguisticProcessing::AbstractResourceBase
LimaFileSystemWatcher & resourceFileWatcher ()
 Accessor to the file watcher used to register resource files to be watched for changes.
 
- Protected Attributes inherited from Lima::LinguisticProcessing::AbstractResourceBase
AbstractResourceBasePrivate * m_d
 
- Protected Attributes inherited from Lima::InitializableObject< AbstractResource, ResourceInitializationParameters >
std::string m_id
 

Detailed Description

LTRTextHandler is a handler for LTR text that gives access to the resulting LTRText through an accessor.

Definition at line 26 of file LTRTextHandler.h.

Constructor & Destructor Documentation

◆ LTRTextHandler()

Lima::LinguisticProcessing::LTRTextHandler::LTRTextHandler ( )

Definition at line 20 of file LTRTextHandler.cpp.

◆ ~LTRTextHandler()

Lima::LinguisticProcessing::LTRTextHandler::~LTRTextHandler ( )
virtual

Definition at line 26 of file LTRTextHandler.cpp.

Member Function Documentation

◆ endAnalysis()

void Lima::LinguisticProcessing::LTRTextHandler::endAnalysis ( )
overridevirtual

function called by the LIMA analyzer on the end of a text part that is to be analyzed

Implements Lima::AbstractAnalysisHandler.

Definition at line 36 of file LTRTextHandler.cpp.

◆ endDocument()

void Lima::LinguisticProcessing::LTRTextHandler::endDocument ( )
overridevirtual

notify the end of the document

Implements Lima::AbstractXmlAnalysisHandler.

Definition at line 57 of file LTRTextHandler.cpp.

◆ endNode()

void Lima::LinguisticProcessing::LTRTextHandler::endNode ( const Common::Misc::GenericDocumentProperties &  props)
overridevirtual

notify the end of a hierarchyNode

Implements Lima::AbstractXmlAnalysisHandler.

Definition at line 69 of file LTRTextHandler.cpp.

◆ getLTRText()

Common::BagOfWords::LTR_Text & Lima::LinguisticProcessing::LTRTextHandler::getLTRText ( )

Definition at line 30 of file LTRTextHandler.cpp.

◆ handle()

void Lima::LinguisticProcessing::LTRTextHandler::handle ( const char *  buf,
int  length 
)
overridevirtual

gives content.

Content is a serialized form of the expected resultType

Implements Lima::AbstractXmlAnalysisHandler.

Definition at line 50 of file LTRTextHandler.cpp.

◆ setOut()

virtual void Lima::LinguisticProcessing::LTRTextHandler::setOut ( std::ostream *  out)
inlineoverridevirtual

set the output stream.

Implementations can be empty if the handler should not write its output to a stream

Implements Lima::AbstractXmlAnalysisHandler.

Definition at line 45 of file LTRTextHandler.h.

◆ startAnalysis()

void Lima::LinguisticProcessing::LTRTextHandler::startAnalysis ( )
overridevirtual

function called by the LIMA analyzer on start of a new document

Parameters
propsthe document properties, which can contain some metadata that are automatically generated by the analyzer (such as language, date of analysis etc), and some metadata that are directly extracted from the document to analyze, in case of the analysis of an XML documents (in this case, the configuration of the analysis indicates in which tags the information can be found) function called by the LIMA analyzer on start at end of a document function called by the LIMA analyzer on the start of a text part that is to be analyzed

Implements Lima::AbstractAnalysisHandler.

Definition at line 43 of file LTRTextHandler.cpp.

◆ startDocument()

void Lima::LinguisticProcessing::LTRTextHandler::startDocument ( const Common::Misc::GenericDocumentProperties &  props)
overridevirtual

notify the start of a new document, and give its properties

Implements Lima::AbstractXmlAnalysisHandler.

Definition at line 61 of file LTRTextHandler.cpp.

◆ startNode()

void Lima::LinguisticProcessing::LTRTextHandler::startNode ( const std::string &  elementName,
bool  forIndexing 
)
overridevirtual

notify the start of a new hierarchyNode

Implements Lima::AbstractXmlAnalysisHandler.

Definition at line 65 of file LTRTextHandler.cpp.


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