LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
AnnotationGraphXmlDumper.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_ANNOTATIONGRAPHXMLDUMPER_H
22
#define LIMA_LINGUISTICPROCESSINGS_ANALYSISDUMPERS_ANNOTATIONGRAPHXMLDUMPER_H
23
24
#include "
AnalysisDumpersExport.h
"
25
26
#include "
linguisticProcessing/common/annotationGraph/AnnotationData.h
"
27
#include "
common/MediaProcessors/MediaProcessUnit.h
"
28
29
#include <boost/tuple/tuple.hpp>
30
#include <boost/graph/properties.hpp>
31
#include "
common/misc/depth_first_searchnowarn.hpp
"
32
#include <boost/graph/breadth_first_search.hpp>
33
34
#include <map>
35
#include <iostream>
36
#include <set>
37
// #include <ext/hash_set>
38
39
namespace
Lima
{
40
namespace
LinguisticProcessing {
41
namespace
AnalysisDumpers {
42
class
FullXmlDumper;
43
}
44
}
45
}
46
47
namespace
Lima
{
48
namespace
LinguisticProcessing {
49
namespace
AnalysisDumpers {
50
51
#define ANNOTATIONGRAPHXMLDUMPER_CLASSID "AnnotationGraphXmlDumper"
52
53
class
LIMA_ANALYSISDUMPERS_EXPORT
AnnotationGraphXmlDumper
:
public
MediaProcessUnit
54
{
55
friend
class
Lima::LinguisticProcessing::AnalysisDumpers::FullXmlDumper
;
56
57
public
:
58
59
AnnotationGraphXmlDumper
();
60
61
virtual
~AnnotationGraphXmlDumper
();
62
63
void
init(
64
Common::XMLConfigurationFiles::GroupConfigurationStructure
& unitConfiguration,
65
Manager
* manager)
override
;
66
67
LimaStatusCode
process(
68
AnalysisContent
& analysis)
const override
;
69
70
LimaStatusCode
dump(
71
AnalysisContent
& analysis,
const
std::string& prologue =
""
)
const
;
72
73
private
:
74
// constructor to be used by FullXmlDumper
75
AnnotationGraphXmlDumper
(
const
MediaId& language,
const
std::string& handler );
76
protected
:
82
class
DumpGraphVisitor
:
public
boost::default_dfs_visitor
83
{
84
const
AnnotationGraphXmlDumper
& m_dumper;
85
const
Common::AnnotationGraphs::AnnotationData
& m_data;
86
std::ostream& m_os;
87
MediaId m_language;
88
89
public
:
90
DumpGraphVisitor
(
const
AnnotationGraphXmlDumper
& dumper,
91
const
Common::AnnotationGraphs::AnnotationData
& annotData,
92
std::ostream& outputStream,
93
MediaId language):
94
m_dumper(dumper),
95
m_data(annotData),
96
m_os(outputStream),
97
m_language(language)
98
{
99
}
100
101
void
discover_vertex(
AnnotationGraphVertex
v,
const
AnnotationGraph
& g);
102
void
examine_edge(
AnnotationGraphEdge
e,
const
AnnotationGraph
& g);
103
void
examine_vertex(
AnnotationGraphVertex
v,
const
AnnotationGraph
& g);
104
class
EndOfSearch
:
public
std::runtime_error
105
{
106
public
:
107
EndOfSearch
():
std
::runtime_error(
""
) {}
108
};
109
};
110
111
void
dumpLimaData(std::ostream& os,
112
const
Common::AnnotationGraphs::AnnotationData
& annotData)
const
;
113
114
void
outputVertex(
const
AnnotationGraphVertex
v,
115
const
AnnotationGraph
& graph,
116
const
Common::AnnotationGraphs::AnnotationData
& annotData,
117
std::ostream& xmlStream)
const
;
118
119
void
outputEdge(
const
AnnotationGraphEdge
e,
120
const
AnnotationGraph
& graph,
121
const
Common::AnnotationGraphs::AnnotationData
& annotData,
122
std::ostream& xmlStream)
const
;
123
124
void
outputVertexIAnnotations(
const
AnnotationGraphVertex
v,
125
const
AnnotationGraph
& graph,
126
const
Common::AnnotationGraphs::AnnotationData
& annotData,
127
std::ostream& xmlStream)
const
;
128
129
void
outputVertexSAnnotations(
const
AnnotationGraphVertex
v,
130
const
AnnotationGraph
& graph,
131
const
Common::AnnotationGraphs::AnnotationData
& annotData,
132
std::ostream& xmlStream)
const
;
133
134
void
outputVertexGAnnotations(
const
AnnotationGraphVertex
v,
135
const
AnnotationGraph
& graph,
136
const
Common::AnnotationGraphs::AnnotationData
& annotData,
137
std::ostream& xmlStream)
const
;
138
139
void
outputEdgeIAnnotations(
const
AnnotationGraphEdge
e,
140
const
AnnotationGraph
& graph,
141
const
Common::AnnotationGraphs::AnnotationData
& annotData,
142
std::ostream& xmlStream)
const
;
143
144
void
outputEdgeSAnnotations(
const
AnnotationGraphEdge
e,
145
const
AnnotationGraph
& graph,
146
const
Common::AnnotationGraphs::AnnotationData
& annotData,
147
std::ostream& xmlStream)
const
;
148
149
void
outputEdgeGAnnotations(
const
AnnotationGraphEdge
e,
150
const
AnnotationGraph
& graph,
151
const
Common::AnnotationGraphs::AnnotationData
& annotData,
152
std::ostream& xmlStream)
const
;
153
154
MediaId
m_language
;
155
std::string
m_handler
;
156
};
157
158
}
// end namespace AnalysisDumpers
159
}
// end namespace LinguisticProcessings
160
}
// end namespace Lima
161
162
#endif
// LIMA_LINGUISTICPROCESSINGS_ANALYSISDUMPERS_ANNOTATIONGRAPHXMLDUMPER_H
AnalysisDumpersExport.h
LIMA_ANALYSISDUMPERS_EXPORT
#define LIMA_ANALYSISDUMPERS_EXPORT
Definition
AnalysisDumpersExport.h:27
AnnotationData.h
This file is the main header file for the data related to annotation graphs.
AnnotationGraph
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, AGVertexProperties, AGEdgeProperties > AnnotationGraph
The graph class.
Definition
AnnotationGraph.h:88
MediaProcessUnit.h
Lima::AnalysisContent
Holds all data that pass through the ProcessUnits Analysis data are shared pointers,...
Definition
AnalysisContent.h:37
Lima::Common::AnnotationGraphs::AnnotationData
Holds an annotation graph and gives an API to manipulate it.
Definition
AnnotationData.h:35
Lima::Common::XMLConfigurationFiles::GroupConfigurationStructure
Definition
groupConfigurationStructure.h:32
Lima::InitializableObjectManager
Manage initialization of InitializableObjects using configuration module and parameters.
Definition
InitializableObjectManager.h:32
Lima::LinguisticProcessing::AnalysisDumpers::AnnotationGraphXmlDumper::DumpGraphVisitor::EndOfSearch
Definition
AnnotationGraphXmlDumper.h:105
Lima::LinguisticProcessing::AnalysisDumpers::AnnotationGraphXmlDumper::DumpGraphVisitor::EndOfSearch::EndOfSearch
EndOfSearch()
Definition
AnnotationGraphXmlDumper.h:107
Lima::LinguisticProcessing::AnalysisDumpers::AnnotationGraphXmlDumper::DumpGraphVisitor
a visitor for going through the graph between two points and storing a BoWToken for every vertex that...
Definition
AnnotationGraphXmlDumper.h:83
Lima::LinguisticProcessing::AnalysisDumpers::AnnotationGraphXmlDumper::DumpGraphVisitor::DumpGraphVisitor
DumpGraphVisitor(const AnnotationGraphXmlDumper &dumper, const Common::AnnotationGraphs::AnnotationData &annotData, std::ostream &outputStream, MediaId language)
Definition
AnnotationGraphXmlDumper.h:90
Lima::LinguisticProcessing::AnalysisDumpers::AnnotationGraphXmlDumper
Definition
AnnotationGraphXmlDumper.h:54
Lima::LinguisticProcessing::AnalysisDumpers::AnnotationGraphXmlDumper::m_handler
std::string m_handler
Definition
AnnotationGraphXmlDumper.h:155
Lima::LinguisticProcessing::AnalysisDumpers::AnnotationGraphXmlDumper::m_language
MediaId m_language
Definition
AnnotationGraphXmlDumper.h:154
Lima::LinguisticProcessing::AnalysisDumpers::FullXmlDumper
Dumps all the content of the analysis on an XML stream.
Definition
fullXmlDumper.h:53
Lima::MediaProcessUnit
Definition
MediaProcessUnit.h:33
depth_first_searchnowarn.hpp
AnnotationGraphEdge
AnnotationGraph::edge_descriptor AnnotationGraphEdge
Definition
AnnotationGraph.h:93
AnnotationGraphVertex
AnnotationGraph::vertex_descriptor AnnotationGraphVertex
Definition
AnnotationGraph.h:97
Lima
NAUTITIA.
Definition
AmosePluginsManager.h:15
Lima::LimaStatusCode
LimaStatusCode
Definition
LimaCommon.h:236
std
STL namespace.
lima_linguisticprocessing
src
linguisticProcessing
core
AnalysisDumpers
AnnotationGraphXmlDumper.h
Generated by
1.9.8