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

abstract handler for XML processing : just inherits from different handlers More...

#include <common/Handler/AbstractXmlDocumentHandler.h>

Inheritance diagram for Lima::AbstractXmlDocumentHandler:
Lima::StructureHandler Lima::AbstractXmlAnalysisHandler Lima::AbstractProcessingClientHandler Lima::ContentHandler< Common::Misc::GenericDocumentProperties > Lima::ContentHandler< std::vector< float > > Lima::AbstractAnalysisHandler Lima::AnalysisData Lima::Handler::MultimediaDocumentHandler Lima::XmlBowDocumentHandler Lima::XmlSimpleHandler Lima::XmlSimpleStreamHandler

Public Member Functions

 AbstractXmlDocumentHandler (std::shared_ptr< const ShiftFrom > shiftFrom)
 
virtual ~AbstractXmlDocumentHandler ()
 
NODE_ID get_parentlastOpenedNode () const
 
void set_parentlastOpenedNode (NODE_ID nodeId)
 
void set_lastNodeId (NODE_ID NID)
 
NODE_ID get_lastNodeId () const
 
std::string get_lastUri () const
 
void set_lastUri (std::string uri)
 
void set_lang (std::string lang)
 
std::string get_lang () const
 
virtual void startAnalysis ()
 function called by the LIMA analyzer on start of a new document
 
virtual void startAnalysis (const std::string &bloc_type)
 
- Public Member Functions inherited from Lima::StructureHandler
 StructureHandler ()
 
virtual ~StructureHandler ()
 
Structure * get_Structures ()
 Récupérer toutes les structures du handler.
 
void set_Structures (Structure *structures)
 Insérer une structure dans le handler.
 
Node * get_Node (CONTENT_ID)
 Récupérer un noeud du handler.
 
void add_Node (const Node &node)
 
STRUCT_ID get_LastStructureId ()
 Accesseur de lastStructureId.
 
void set_LastStructureId (STRUCT_ID)
 
CONTENT_ID get_LastContentId ()
 
void set_LastContentId (CONTENT_ID)
 
void resetStructure ()
 
- Public Member Functions inherited from Lima::AbstractXmlAnalysisHandler
 AbstractXmlAnalysisHandler (std::shared_ptr< const ShiftFrom > shiftFrom)
 
virtual ~AbstractXmlAnalysisHandler ()
 
virtual void startDocument (const Common::Misc::GenericDocumentProperties &props)=0
 notify the start of a new document, and give its properties
 
virtual void endDocument ()=0
 notify the end of the document
 
virtual void handle (const char *buf, int length) override=0
 gives content.
 
virtual void startNode (const std::string &elementName, bool forIndexing)=0
 notify the start of a new hierarchyNode
 
virtual void endNode (const Common::Misc::GenericDocumentProperties &props)=0
 notify the end of a hierarchyNode
 
virtual void setOut (std::ostream *out)=0
 set the output stream.
 
std::shared_ptr< const ShiftFrom > shiftFrom () const
 
- Public Member Functions inherited from Lima::AbstractAnalysisHandler
virtual ~AbstractAnalysisHandler ()
 
virtual void endAnalysis ()=0
 function called by the LIMA analyzer on the end of a text part that is to be analyzed
 
- Public Member Functions inherited from Lima::AnalysisData
virtual ~AnalysisData ()
 
- Public Member Functions inherited from Lima::AbstractProcessingClientHandler
virtual ~AbstractProcessingClientHandler ()
 
virtual void setAnalysisClient (const std::string &clientId, std::shared_ptr< AbstractProcessingClient > client)
 
virtual std::shared_ptr< AbstractProcessingClient > getAnalysisClient (const std::string &clientId)
 
virtual std::map< std::string, std::shared_ptr< AbstractProcessingClient > > getAnalysisClients () const
 
virtual void setAnalysisClients (std::map< std::string, std::shared_ptr< AbstractProcessingClient > > clients)
 
virtual void handleProc (const std::string &tagName, const std::string &content, const std::map< std::string, std::string > &metaData, const std::string &pipeline, const std::map< std::string, AbstractAnalysisHandler * > &handlers=std::map< std::string, AbstractAnalysisHandler * >(), const std::set< std::string > &inactiveUnits=std::set< std::string >())
 
- Public Member Functions inherited from Lima::ContentHandler< Common::Misc::GenericDocumentProperties >
 ContentHandler ()
 
virtual ~ContentHandler ()
 
void addContent (CONTENT_ID ContentId, Common::Misc::GenericDocumentProperties datas)
 Ajouter un contenu au handler.
 
void setContents (const std::map< CONTENT_ID, Common::Misc::GenericDocumentProperties > contents)
 
Common::Misc::GenericDocumentProperties * getContent (CONTENT_ID ContentId)
 Récupérer un contenu du handler.
 
const std::map< CONTENT_ID, Common::Misc::GenericDocumentProperties > & getContents () const
 Récupérer tous les contenus du handler.
 
void resetHandler ()
 Effacer les contenus du handler.
 
- Public Member Functions inherited from Lima::ContentHandler< std::vector< float > >
 ContentHandler ()
 
virtual ~ContentHandler ()
 
void addContent (CONTENT_ID ContentId, std::vector< float > datas)
 Ajouter un contenu au handler.
 
void setContents (const std::map< CONTENT_ID, std::vector< float > > contents)
 
std::vector< float > * getContent (CONTENT_ID ContentId)
 Récupérer un contenu du handler.
 
const std::map< CONTENT_ID, std::vector< float > > & getContents () const
 Récupérer tous les contenus du handler.
 
void resetHandler ()
 Effacer les contenus du handler.
 

Public Attributes

std::vector< NODE_ID > m_openedNodes
 
std::vector< NODE_ID >::iterator m_lastOpenedNode
 
NODE_ID m_parentlastOpenedNode
 
NODE_ID m_lastNode
 
std::map< std::string, std::string > m_metadata
 

Detailed Description

abstract handler for XML processing : just inherits from different handlers

Definition at line 31 of file AbstractXmlDocumentHandler.h.

Constructor & Destructor Documentation

◆ AbstractXmlDocumentHandler()

Lima::AbstractXmlDocumentHandler::AbstractXmlDocumentHandler ( std::shared_ptr< const ShiftFrom >  shiftFrom)
inline

Definition at line 39 of file AbstractXmlDocumentHandler.h.

◆ ~AbstractXmlDocumentHandler()

virtual Lima::AbstractXmlDocumentHandler::~AbstractXmlDocumentHandler ( )
inlinevirtual

Definition at line 52 of file AbstractXmlDocumentHandler.h.

Member Function Documentation

◆ get_lang()

std::string Lima::AbstractXmlDocumentHandler::get_lang ( ) const
inline

Definition at line 90 of file AbstractXmlDocumentHandler.h.

◆ get_lastNodeId()

NODE_ID Lima::AbstractXmlDocumentHandler::get_lastNodeId ( ) const
inline

Definition at line 67 of file AbstractXmlDocumentHandler.h.

◆ get_lastUri()

std::string Lima::AbstractXmlDocumentHandler::get_lastUri ( ) const
inline

Definition at line 72 of file AbstractXmlDocumentHandler.h.

◆ get_parentlastOpenedNode()

NODE_ID Lima::AbstractXmlDocumentHandler::get_parentlastOpenedNode ( ) const
inline

Definition at line 54 of file AbstractXmlDocumentHandler.h.

◆ set_lang()

void Lima::AbstractXmlDocumentHandler::set_lang ( std::string  lang)
inline

Definition at line 85 of file AbstractXmlDocumentHandler.h.

◆ set_lastNodeId()

void Lima::AbstractXmlDocumentHandler::set_lastNodeId ( NODE_ID  NID)
inline

Definition at line 62 of file AbstractXmlDocumentHandler.h.

◆ set_lastUri()

void Lima::AbstractXmlDocumentHandler::set_lastUri ( std::string  uri)
inline

Definition at line 80 of file AbstractXmlDocumentHandler.h.

◆ set_parentlastOpenedNode()

void Lima::AbstractXmlDocumentHandler::set_parentlastOpenedNode ( NODE_ID  nodeId)
inline

Definition at line 58 of file AbstractXmlDocumentHandler.h.

◆ startAnalysis() [1/2]

virtual void Lima::AbstractXmlDocumentHandler::startAnalysis ( )
inlinevirtual

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.

Reimplemented in Lima::Handler::MultimediaDocumentHandler, Lima::XmlBowDocumentHandler, Lima::XmlSimpleHandler, and Lima::XmlSimpleStreamHandler.

Definition at line 98 of file AbstractXmlDocumentHandler.h.

◆ startAnalysis() [2/2]

virtual void Lima::AbstractXmlDocumentHandler::startAnalysis ( const std::string &  bloc_type)
inlinevirtual

Reimplemented in Lima::Handler::MultimediaDocumentHandler.

Definition at line 99 of file AbstractXmlDocumentHandler.h.

Member Data Documentation

◆ m_lastNode

NODE_ID Lima::AbstractXmlDocumentHandler::m_lastNode

Definition at line 104 of file AbstractXmlDocumentHandler.h.

◆ m_lastOpenedNode

std::vector<NODE_ID>::iterator Lima::AbstractXmlDocumentHandler::m_lastOpenedNode

Definition at line 102 of file AbstractXmlDocumentHandler.h.

◆ m_metadata

std::map<std::string,std::string> Lima::AbstractXmlDocumentHandler::m_metadata

Definition at line 105 of file AbstractXmlDocumentHandler.h.

◆ m_openedNodes

std::vector<NODE_ID> Lima::AbstractXmlDocumentHandler::m_openedNodes

Definition at line 101 of file AbstractXmlDocumentHandler.h.

◆ m_parentlastOpenedNode

NODE_ID Lima::AbstractXmlDocumentHandler::m_parentlastOpenedNode

Definition at line 103 of file AbstractXmlDocumentHandler.h.


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