LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
DepTripletLogger.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 * A logger used to output dependency relations in a parsable manner *
8 * Copyright (C) 2004-2012 by CEA LIST *
9 * *
10 ***************************************************************************/
11#ifndef LIMA_LINGUISTICPROCESSING_SYNTACTICANALYSISDEPTRIPLELOGGER_H
12#define LIMA_LINGUISTICPROCESSING_SYNTACTICANALYSISDEPTRIPLELOGGER_H
13
16
19
20namespace Lima
21{
22
23namespace Common
24{
25 namespace BagOfWords
26 {
27 class BoWToken;
28 class BoWTerm;
29 }
30 namespace AnnotationGraphs
31 {
32 class AnnotationData;
33 }
34}
35
36namespace LinguisticProcessing
37{
38namespace Compounds
39{
40 class BowGenerator;
41}
42
43namespace LinguisticAnalysisStructure
44{
45 class AnalysisGraph;
46}
47
48namespace SyntacticAnalysis
49{
50
51
52#define DEPTRIPLETLOGGER_CLASSID "DepTripletLogger"
53
54typedef std::map< LinguisticGraphVertex, std::set<const Common::BagOfWords::BoWTerm*> > VxToTermsMap ;
55
63{
64public:
66
67 virtual ~DepTripletLogger();
68
69 void init(
71 Manager* manager) override;
72
73 LimaStatusCode process(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,
88 const LinguisticGraph& anagraph,
89 const LinguisticGraph& posgraph,
91 const Common::AnnotationGraphs::AnnotationData* annotationData,
92 const VxToTermsMap& compoundsHeads) const;
93
94 VxToTermsMap getCompoundsHeads(
95 const Common::AnnotationGraphs::AnnotationData* annotationData,
96 const SyntacticAnalysis::SyntacticData* syntacticData,
97 AnalysisContent& analysis,
99 const LinguisticGraph& anagraph,
100 const LinguisticGraph& posgraph) const;
101
102 void getCompoundsHeads(VxToTermsMap&, const Common::BagOfWords::BoWTerm* bt) const;
103
104 void collectVertices(
105 std::set<LinguisticGraphVertex>& theSet,
107 ) const;
108
109 MediaId m_language;
110 std::set<std::string> m_relation_names;
111
112 const Common::PropertyCode::PropertyAccessor* m_macroAccessor;
113 const Common::PropertyCode::PropertyAccessor* m_microAccessor;
114
115 Compounds::BowGenerator* m_bowGenerator;
116};
117
118/*
119struct lFullToken
120{
121 inline bool operator()(const Data::FullToken* f1, const Data::FullToken* f2) const
122 {
123 if (f1->getPosition()!=f2->getPosition()) return f1->getPosition()<f2->getPosition();
124 return f1->getLength()<f2->getLength();
125 }
126};
127*/
128
129} // closing namespace SyntacticAnalysis
130} // closing namespace LinguisticProcessing
131} // closing namespace Lima
132
133#endif // LIMA_LINGUISTICPROCESSING_SYNTACTICANALYSISDEPTRIPLELOGGER_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.
This is a complex token used to represent a multiword term.
Definition bowTerm.h:36
This class contains the representation of an element of the bag of words.
Definition bowToken.h:46
Provide function to read write and check a property.
Manage initialization of InitializableObjects using configuration module and parameters.
A generic process unit to log information in files: contains some common informations such as : outpu...
Parameters retrived in the configuration file:
An AnalysisData containing a LinguisticGraph with a language and an id.
A logger used to output dependency relations in a parsable manner (term1-dependance-term2)
This class points to a graph, its dependency graph and the structure that holds the maping between th...
std::map< LinguisticGraphVertex, std::set< const Common::BagOfWords::BoWTerm * > > VxToTermsMap
NAUTITIA.
LimaStatusCode
Definition LimaCommon.h:236