LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
MetaDataHandler.h
Go to the documentation of this file.
1// Copyright 2002-2020 CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
6#ifndef LIMA_LINGUISTICPROCESSING_METADATAHANDLER_H
7#define LIMA_LINGUISTICPROCESSING_METADATAHANDLER_H
8
13
14#include <ostream>
15
16namespace Lima
17{
19{
20
22{
23 Q_OBJECT
24public:
25 MetaDataHandler(std::ostream* out);
26
28 virtual ~MetaDataHandler();
29
30
31 virtual void endAnalysis() override;
32 virtual void handle(const char* buf, int length) override ;
33 virtual void startAnalysis() override;
34
36 void endDocument() override;
37 void startNode( const std::string& elementName, bool forIndexing ) override;
38 void endNode(const Common::Misc::GenericDocumentProperties& props) override;
39
40 virtual void setOut( std::ostream* out ) override;
41
42 const std::map<std::string,std::string>& getMetaData();
43
44private:
45 std::ostringstream* m_stream;
46 std::ostream* m_out;
48 std::map<std::string,std::string> m_metadata;
49
50};
51
52} // closing namespace LinguisticProcessing
53} // closing namespace Lima
54
55#endif
#define LIMA_ANALYSISHANDLERS_EXPORT
void startNode(const std::string &elementName, bool forIndexing) override
notify the start of a new hierarchyNode
virtual void setOut(std::ostream *out) override
set the output stream.
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
virtual void endAnalysis() override
function called by the LIMA analyzer on the end of a text part that is to be analyzed
void endNode(const Common::Misc::GenericDocumentProperties &props) override
notify the end of a hierarchyNode
void endDocument() override
notify the end of the document
void startDocument(const Common::Misc::GenericDocumentProperties &) override
notify the start of a new document, and give its properties
const std::map< std::string, std::string > & getMetaData()
NAUTITIA.