LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
SyntacticAnalysisXmlLogger.h
Go to the documentation of this file.
1// Copyright 2002-2013 CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
16#ifndef SYNTACTICANALYSISXMLLOGGERSPECIFICENTITIESXMLLOGGER_H
17#define SYNTACTICANALYSISXMLLOGGERSPECIFICENTITIESXMLLOGGER_H
18
24
25
26namespace Lima
27{
28namespace LinguisticProcessing
29{
30namespace SyntacticAnalysis
31{
32
33class SyntacticData;
34
35#define SYNTACTICANALYSISXMLLOGGER_CLASSID "SyntacticAnalysisXmlLogger"
36
41{
42public:
45
48
58 virtual void init(
60 Manager* manager) override
61 ;
62
70 virtual LimaStatusCode process(
71 AnalysisContent& analysis) const override;
72
73private:
74
89 void dumpLimaData(std::ostream& os,
90 const LinguisticGraphVertex begin,
91 const LinguisticGraphVertex end,
93 const SyntacticAnalysis::SyntacticData* syntacticData,
94 const uint64_t offsetBegin=0) const;
103 class DumpGraphVisitor : public boost::default_bfs_visitor
104 {
106 const SyntacticAnalysisXmlLogger& m_dumper;
108 std::ostream& m_os;
110 LinguisticGraphVertex m_lastVertex;
112 const SyntacticAnalysis::SyntacticData* m_syntacticData;
114 MediaId m_language;
116 uint64_t m_offsetBegin;
119 std::map< LinguisticAnalysisStructure::Token*, uint64_t >& m_tokens;
126 std::vector< bool >& m_alreadyDumpedTokens;
127
128 public:
131 DumpGraphVisitor(const SyntacticAnalysisXmlLogger& dumper,
132 std::ostream& outputStream,
133 const LinguisticGraphVertex& end,
134 const SyntacticAnalysis::SyntacticData* syntacticData,
135 std::map< LinguisticAnalysisStructure::Token*, uint64_t >& tokens,
136 std::vector< bool >& alreadyDumpedTokens,
137 MediaId language,
138 const uint64_t offsetBegin):
139 m_dumper(dumper),
140 m_os(outputStream),
141 m_lastVertex(end),
142 m_syntacticData(syntacticData),
143 m_language(language),
144 m_offsetBegin(offsetBegin),
145 m_tokens(tokens),
146 m_alreadyDumpedTokens(alreadyDumpedTokens)
147 {
148 }
149
156 void discover_vertex(LinguisticGraphVertex v, const LinguisticGraph& g);
157
164 void examine_vertex(LinguisticGraphVertex v, const LinguisticGraph& g);
165
172 void examine_edge(LinguisticGraphEdge e, const LinguisticGraph& g);
173
178 class EndOfSearch : public std::runtime_error
179 {
180 public:
181 EndOfSearch():std::runtime_error("") {}
182 };
183 };
184
185
194 static LimaString getPosition(const uint64_t position,
195 const uint64_t offsetBegin);
196
213 void outputVertex(const LinguisticGraphVertex v,
214 const LinguisticGraph& graph,
215 const uint64_t offsetBegin,
216 const SyntacticAnalysis::SyntacticData* syntacticData,
217 std::ostream& xmlStream,
218 std::map< LinguisticAnalysisStructure::Token*, uint64_t >& fullTokens,
219 std::vector< bool >& alreadyDumpedFullTokens) const;
220
227 void outputEdge(const LinguisticGraphEdge e,
228 const LinguisticGraph& graph,
229 std::ostream& xmlStream) const;
230
232 MediaId m_language;
233
239 const Common::PropertyCode::PropertyCodeManager* m_propertyCodeManager;
240
241};
242
243} // SyntacticAnalysis
244} // LinguisticProcessing
245} // Lima
246
247#endif
A graph structure for linguistic analysis.
boost::graph_traits< LinguisticGraph >::edge_descriptor LinguisticGraphEdge
typedefs to simplify the access to various graphs elements
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, LinguisticVertexProperties > LinguisticGraph
Property to identify the chains in the graph.
#define LIMA_SYNTACTICANALYSIS_EXPORT
Holds all data that pass through the ProcessUnits Analysis data are shared pointers,...
Provide tools to parse a property file, and deal with the property coding system.
Manage initialization of InitializableObjects using configuration module and parameters.
An AnalysisData containing a LinguisticGraph with a language and an id.
This class points to a graph, its dependency graph and the structure that holds the maping between th...
NAUTITIA.
LimaStatusCode
Definition LimaCommon.h:236
QString LimaString
Definition LimaString.h:33
STL namespace.