LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
CoreXmlReaderClient.h
Go to the documentation of this file.
1// Copyright 2009-2021 CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
6#ifndef COREXMLREADERCLIENT_H
7#define COREXMLREADERCLIENT_H
8
13
14namespace Lima {
15 class AbstractXmlDocumentHandler;
16}
17
18namespace Lima {
19namespace DocumentsReader {
20 class DocumentReader;
21 class ContentStructuredDocument;
22 class DocumentPropertyType;
23}
24namespace XmlReader {
25
38{
39public:
43
46
47 //-------------------------------------------------------------
48 // En tant que client d'analyse (AbstractXmlReaderClient)
49 //-------------------------------------------------------------
55 std::shared_ptr<AnalysisContent> analyze(
56 const std::string& content,
57 const std::map<std::string,std::string>& metaData,
58 const std::string& pipeline,
59 const std::map<std::string, Lima::AbstractAnalysisHandler*>& handlers = std::map<std::string, Lima::AbstractAnalysisHandler*>(),
60 const std::set<std::string>& inactiveUnits = std::set<std::string>()) const override;
61
63 void setAnalysisHandler(const std::string& handlerId, Lima::AbstractAnalysisHandler* handler) override;
64
66 void releaseAnalysisHandler(const std::string &handlerId) override;
67
68
69 //---------------------------------------------------------------
70 // En tant que handler de XML (StructuredXmlDocumentHandler)
71 //---------------------------------------------------------------
72
73 void startHierarchy ( const DocumentsReader::ContentStructuredDocument& contentDocument ) override;
74
75 void endHierarchy ( const DocumentsReader::ContentStructuredDocument& contentDocument ) override;
76
77 void startIndexing ( const DocumentsReader::ContentStructuredDocument& contentDocument ) override ;
78 void endIndexing ( const DocumentsReader::ContentStructuredDocument& contentDocument ) override;
79
86 void handle (const DocumentsReader::ContentStructuredDocument& contentDocument,
87 const Lima::LimaString& text,
88 unsigned long int offset,
89 const std::string tagName) override;
90
91 void handleProperty ( const DocumentsReader::DocumentPropertyType& property,
92 const std::string& data ) override ;
93
94private:
95 void startNode ( const DocumentsReader::ContentStructuredDocument& contentDocument, bool isIndexing );
96
99
101 DocumentsReader::DocumentReader* m_documentReader;
102
103 // arguments pour l'analyseur, initialise avec l'argument metadata d'analyze()
104 // contient eventuellement des valeurs pour "FileName" et "Lang" et "Type" ??
105 std::map<std::string,std::string> m_docMetaData;
106
108 Lima::LimaString m_emptyTextChars;
109
111 std::map<std::string, Lima::AbstractAnalysisHandler*> m_mapHandlers;
112
113 // @brief resultat de l'analyse du fichier XML
114// std::map<std::string, std::map<int , std::map<int, std::vector< std::pair<int, std::string> > > > > m_mapToIndex;
115// LinguisticProcessing::AbstractLinguisticProcessingClient* m_delegate;
116};
117
120{
121public:
122
123 void configure(
125 const std::string& defaultMedia,
126 const std::deque<std::string>& medias,
127 const std::deque<std::string>& pipelines) override;
128
129 std::shared_ptr< AbstractXmlReaderClient > createClient(Lima::Common::XMLConfigurationFiles::XMLConfigurationFileParser *configuration) const override;
130
132
133private:
135 static std::unique_ptr< CoreXmlReaderClientFactory > s_instance;
136
137 std::string m_defaultMedia;
138};
139
146
147} // XmlReader
148} // Lima
149
150
151
152#endif
#define COREXMLREADERCLIENT_EXPORT
Symbol exporting for Windows DLL CoreXmlReaderClient.dll.
The AbstractAnalysisHandler class defines the callback interface: the functions that are to be define...
abstract handler for XML processing : just inherits from different handlers
Parser class for the lima's xml configuration files.
Partie d'un document structure decodee avant analyse.
Handler pour les elements de parsing de document structure.
A factory for the AbstractXmlReaderClient: contains the registration of all implemented clients that ...
interface publique au client d'analyse de fichier XML
fabrique du client d'analyse de document XML
client de lecture des fichier XML faisant appel aux clients d'analyse Lors de la lecture d'un fichier...
NAUTITIA.
QString LimaString
Definition LimaString.h:33