LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
DepTripleDumper.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
6/***************************************************************************
7 * Copyright (C) 2004-2012 by CEA LIST *
8 * *
9 ***************************************************************************/
10#ifndef LIMA_LINGUISTICPROCESSING_ANALYSISDUMPERSDEPTRIPLEDUMPER_H
11#define LIMA_LINGUISTICPROCESSING_ANALYSISDUMPERSDEPTRIPLEDUMPER_H
12
15
18
19#include <boost/shared_ptr.hpp>
20
21namespace Lima
22{
23
24namespace Common
25{
26 namespace BagOfWords
27 {
28 class BoWToken;
29 class BoWTerm;
30 }
31 namespace AnnotationGraphs
32 {
33 class AnnotationData;
34 }
35}
36
37namespace LinguisticProcessing
38{
39namespace Compounds
40{
41 class BowGenerator;
42}
43
44namespace LinguisticAnalysisStructure
45{
46 class AnalysisGraph;
47}
48
49namespace AnalysisDumpers
50{
51
52
53#define DEPTRIPLEDUMPER_CLASSID "DepTripleDumper"
54
55typedef std::map< LinguisticGraphVertex, std::set< boost::shared_ptr< Common::BagOfWords::BoWTerm > > > VxToTermsMap ;
56
62{
63public:
65
66 virtual ~DepTripleDumper();
67
68 void init(
70 Manager* manager) override;
71
72 LimaStatusCode process(
73 AnalysisContent& analysis) const override;
74
75private:
76 void dumpDepWithCompounds(
77 std::ostream& outputStream,
78 const LinguisticGraph& anagraph,
79 const LinguisticGraph& posgraph,
81 const Common::AnnotationGraphs::AnnotationData* annotationData,
84 const std::string& rel,
85 const VxToTermsMap& compoundsHeads) const;
86
87 void dumpDependencyRelations(std::ostream& outputStream,
90 const LinguisticGraph& anagraph,
91 const LinguisticGraph& posgraph,
93 const Common::AnnotationGraphs::AnnotationData* annotationData,
94 const VxToTermsMap& compoundsHeads) const;
95
96 VxToTermsMap getCompoundsHeads(
97 const Common::AnnotationGraphs::AnnotationData* annotationData,
98 const SyntacticAnalysis::SyntacticData* syntacticData,
99 AnalysisContent& analysis,
101 const LinguisticGraph& anagraph,
102 const LinguisticGraph& posgraph) const;
103
104 void getCompoundsHeads(VxToTermsMap&, boost::shared_ptr< Common::BagOfWords::BoWTerm > bt) const;
105
106 void collectVertices(
107 std::set<LinguisticGraphVertex>& theSet,
108 boost::shared_ptr< Common::BagOfWords::BoWToken > term
109 ) const;
110
111 MediaId m_language;
112 std::set<std::string> m_relation_names;
113
114 const Common::PropertyCode::PropertyAccessor* m_macroAccessor;
115 const Common::PropertyCode::PropertyAccessor* m_microAccessor;
116
117 Compounds::BowGenerator* m_bowGenerator;
118 std::string m_handler;
119};
120
121/*
122struct lFullToken
123{
124 inline bool operator()(const Data::FullToken* f1, const Data::FullToken* f2) const
125 {
126 if (f1->getPosition()!=f2->getPosition()) return f1->getPosition()<f2->getPosition();
127 return f1->getLength()<f2->getLength();
128 }
129};
130*/
131
132} // closing namespace AnalysisDumpers
133} // closing namespace LinguisticProcessing
134} // closing namespace Lima
135
136#endif // LIMA_LINGUISTICPROCESSING_ANALYSISDUMPERSDEPTRIPLEDUMPER_H
#define LIMA_ANALYSISDUMPERS_EXPORT
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,...
Holds an annotation graph and gives an API to manipulate it.
Provide function to read write and check a property.
Manage initialization of InitializableObjects using configuration module and parameters.
Parameters retrived in the configuration file:
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...
std::map< LinguisticGraphVertex, std::set< boost::shared_ptr< Common::BagOfWords::BoWTerm > > > VxToTermsMap
NAUTITIA.
LimaStatusCode
Definition LimaCommon.h:236