LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
fullXmlDumper.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
21#ifndef LIMA_LINGUISTICPROCESSINGS_ANALYSISDUMPERS_FULLXMLDUMPER_H
22#define LIMA_LINGUISTICPROCESSINGS_ANALYSISDUMPERS_FULLXMLDUMPER_H
23
25
27#include "StopList.h"
32
33#include <boost/tuple/tuple.hpp>
34#include <boost/graph/properties.hpp>
35
36#include <map>
37#include <iostream>
38#include <set>
39
40namespace Lima {
41namespace LinguisticProcessing {
42namespace AnalysisDumpers {
43
44#define FULLXMLDUMPER_CLASSID "FullXmlDumper"
45
53{
54public:
55
57
58 virtual ~FullXmlDumper();
59
60 void init(
62 Manager* manager) override
63 ;
64
65 LimaStatusCode process(
66 AnalysisContent& analysis) const override;
67
68
69protected:
71
72 void dumpLimaData(std::ostream& os,
73 const LinguisticGraphVertex begin,
74 const LinguisticGraphVertex end,
76 const SyntacticAnalysis::SyntacticData* syntacticData,
77 const std::string& graphId,
78 bool bySentence,
79 std::vector< bool >& alreadyDumpedTokens,
80 std::map< LinguisticAnalysisStructure::Token*, uint64_t >& fullTokens) const;
86 class DumpGraphVisitor : public boost::default_bfs_visitor
87 {
88 const FullXmlDumper& m_dumper;
89 std::ostream& m_os;
90 LinguisticGraphVertex m_lastVertex;
91 const SyntacticAnalysis::SyntacticData* m_syntacticData;
92 MediaId m_language;
93 std::map< LinguisticAnalysisStructure::Token*, uint64_t >& m_fullTokens;
94 std::vector< bool >& m_alreadyDumpedFullTokens;
95 const std::string& m_graphId;
96
97 public:
99 std::ostream& outputStream,
100 const LinguisticGraphVertex& end,
101 const SyntacticAnalysis::SyntacticData* syntacticData,
102 std::map< LinguisticAnalysisStructure::Token*, uint64_t >& fullTokens,
103 std::vector< bool >& alreadyDumpedFullTokens,
104 MediaId language,
105 const std::string& graphId):
106 m_dumper(dumper),
107 m_os(outputStream),
108 m_lastVertex(end),
109 m_syntacticData(syntacticData),
110 m_language(language),
111 m_fullTokens(fullTokens),
112 m_alreadyDumpedFullTokens(alreadyDumpedFullTokens),
113 m_graphId(graphId)
114 {
115 }
116
117 void discover_vertex(LinguisticGraphVertex v, const LinguisticGraph& g);
118 void examine_edge(LinguisticGraphEdge e, const LinguisticGraph& g);
119 void examine_vertex(LinguisticGraphVertex v, const LinguisticGraph& g);
120 class EndOfSearch : public std::runtime_error
121 {
122 public:
123 EndOfSearch():std::runtime_error("") {}
124 };
125 };
126
127 LimaString getPosition(const uint64_t position) const;
128
129 void outputVertex(const LinguisticGraphVertex v,
130 const LinguisticGraph& graph,
131 const SyntacticAnalysis::SyntacticData* syntacticData,
132 std::ostream& xmlStream,
133 std::map< LinguisticAnalysisStructure::Token*, uint64_t >& fullTokens,
134 std::vector< bool >& alreadyDumpedFullTokens,
135 const std::string& graphId) const;
136
137 void outputEdge(const LinguisticGraphEdge e,
138 const LinguisticGraph& graph,
139 std::ostream& xmlStream) const;
140
141 MediaId m_language;
143
145 std::string m_graph;
146 std::string m_handler;
147};
148
149} // end namespace AnalysisDumpers
150} // end namespace LinguisticProcessings
151} // end namespace Lima
152
153#endif // LIMA_LINGUISTICPROCESSINGS_ANALYSISDUMPERS_FULLXMLDUMPER_H
#define LIMA_ANALYSISDUMPERS_EXPORT
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.
Data used for the syntactic analyzis of texts.
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.
a visitor for going through the graph between two points and storing a BoWToken for every vertex that...
DumpGraphVisitor(const FullXmlDumper &dumper, std::ostream &outputStream, const LinguisticGraphVertex &end, const SyntacticAnalysis::SyntacticData *syntacticData, std::map< LinguisticAnalysisStructure::Token *, uint64_t > &fullTokens, std::vector< bool > &alreadyDumpedFullTokens, MediaId language, const std::string &graphId)
Dumps all the content of the analysis on an XML stream.
const Common::PropertyCode::PropertyCodeManager * m_propertyCodeManager
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.