LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
SimpleXmlDumper.h
Go to the documentation of this file.
1// Copyright 2002-2020 CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
6/***************************************************************************
7 * Copyright (C) 2010 by CEA LIST *
8 * *
9 ***************************************************************************/
10#ifndef LIMA_LINGUISTICPROCESSING_SIMPLEXMLBOWDUMPER_H
11#define LIMA_LINGUISTICPROCESSING_SIMPLEXMLBOWDUMPER_H
12
14
15
17
26
27namespace Lima {
28namespace LinguisticProcessing {
29namespace AnalysisDumpers {
30
31#define SIMPLEXMLDUMPER_CLASSID "SimpleXmlDumper"
32
37{
38public:
40
41 virtual ~SimpleXmlDumper();
42
43 virtual void init(
45 Manager* manager) override;
46
47 virtual LimaStatusCode process(AnalysisContent& analysis) const override;
48
49protected:
50 std::string m_graph;
51 std::string m_property;
54
55 // output of some specific properties (temporary: should be inserted in WordFeatures with XML output)
58 std::string m_encapsulatingTag;
61
62 // private member functions
63 void xmlOutput(std::ostream& out,
64 AnalysisContent& analysis,
67 const Common::AnnotationGraphs::AnnotationData* annotationData) const;
68
69 void xmlOutputVertices(std::ostream& out,
72 const Common::AnnotationGraphs::AnnotationData* annotationData,
73 const LinguisticGraphVertex begin,
74 const LinguisticGraphVertex end,
75 const FsaStringsPool& sp,const uint64_t offset) const;
76
77 void xmlOutputVertex(std::ostream& out,
82 const Common::AnnotationGraphs::AnnotationData* annotationData,
83 const FsaStringsPool& sp,
84 uint64_t offset) const;
85
86 void xmlOutputVertexInfos(std::ostream& out,
88 const std::vector<LinguisticAnalysisStructure::MorphoSyntacticData*>& data,
89 const FsaStringsPool& sp,
90 uint64_t offset,
91 LinguisticCode category=L_NONE) const;
92
93 bool outputSpecificEntity(std::ostream& out,
96 const LinguisticGraph* graph,
97 const FsaStringsPool& sp,
98 const uint64_t offset) const;
99
100 // string manipulation functions to protect XML entities
101 std::string xmlString(const std::string& str) const;
102 void replace(std::string& str, const std::string& toReplace, const std::string& newValue) const;
103
104};
105
106} // AnalysisDumpers
107} // LinguisticProcessing
108} // Lima
109
110#endif
#define LIMA_ANALYSISDUMPERS_EXPORT
A graph that stores any data (annotations) referencing primarily nodes of a text anlaysis.
A graph structure for linguistic analysis.
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, LinguisticVertexProperties > LinguisticGraph
Property to identify the chains in the graph.
#define L_NONE
Definition StdBitset.h:338
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.
Provide tools to manage a specific property.
Manage initialization of InitializableObjects using configuration module and parameters.
const Common::PropertyCode::PropertyManager * m_tenseManager
const Common::PropertyCode::PropertyAccessor * m_tenseAccessor
const Common::PropertyCode::PropertyManager * m_propertyManager
const Common::PropertyCode::PropertyAccessor * m_propertyAccessor
An AnalysisData containing a LinguisticGraph with a language and an id.
A representation of a specific entity to store in the annotation graph.
NAUTITIA.
LimaStatusCode
Definition LimaCommon.h:236