LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
EventParagraph.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 *
8 * @file Paragraph.h
9 * @author Faiza GARA
10 * @date April 2008
11 * copyright Copyright (C) 2007 by CEA LIST
12 * version $Id:
13 *
14 * @brief
15 *
16 *
17 ***********************************************************************/
18
19#ifndef EVENTPARAGRAPH_H
20#define EVENTPARAGRAPH_H
21
22#include "EventAnalysisExport.h"
25
27
28namespace Lima {
29namespace LinguisticProcessing
30{
31
32namespace EventAnalysis
33{
34
35
37{
38public:
40
42
43 EventParagraph(Paragraph *p, bool splitted,Common::AnnotationGraphs::AnnotationData*, std::string graphId,LinguisticGraph* graph);
44
45 bool is_splitted();
46
47 bool has_entity(Common::MediaticData::EntityType t) const;
48
49 void addEventEntities(Paragraph *p,Common::AnnotationGraphs::AnnotationData*, std::string graphId,LinguisticGraph* graph);
50
51 void addEntities(Paragraph *p,Common::AnnotationGraphs::AnnotationData*, std::string graphId,LinguisticGraph* graph);
52
53 std::map<Common::MediaticData::EntityType,std::vector<Entity *> > getOtherEntities();
54
55 std::pair<Common::MediaticData::EntityType,std::vector<Entity *> > getEventEntities();
56
57 uint64_t getId() const;
58 uint64_t getPosition() const;
59 uint64_t getStart() const;
60 uint64_t getEnd() const;
61 uint64_t getLength() const;
62
63 void setId(uint64_t id);
64 void setPosition(uint64_t position);
65 void setLength(uint64_t length);
66 void clear();
67
68 // direct insertion of a known entity
69 void addEntity(const Common::MediaticData::EntityType& type, Entity* entity);
70 void addEventEntity(const Common::MediaticData::EntityType& type, Entity* entity);
71
72 virtual ~EventParagraph();
73
75 virtual void read(std::istream& file);
76 virtual void write(std::ostream& file) const;
77
78 std::string toString(std::string parentURI,uint64_t index, bool main) const;
79
80 private:
81 bool m_splitted;
82 std::map<Common::MediaticData::EntityType,std::vector<Entity *> >m_otherentities;
83 std::pair<Common::MediaticData::EntityType,std::vector<Entity *> > m_evententities;
84 uint64_t m_length;
85 uint64_t m_position;
86 uint64_t m_id;
87
89
90};
91
92inline bool EventParagraph::is_splitted(){ return (m_splitted == true);}
93
94inline std::map<Common::MediaticData::EntityType,std::vector<Entity *> > EventParagraph::getOtherEntities(){return m_otherentities;}
95
96inline std::pair<Common::MediaticData::EntityType,std::vector<Entity *> > EventParagraph::getEventEntities(){return m_evententities;}
97
98inline uint64_t EventParagraph::getId() const {return m_id;}
99inline uint64_t EventParagraph::getPosition() const {return m_position;}
100inline uint64_t EventParagraph::getStart() const {return m_position;}
101inline uint64_t EventParagraph::getEnd() const {return (m_position+m_length-1);}
102inline uint64_t EventParagraph::getLength() const {return m_length;}
103
104inline void EventParagraph::setId(uint64_t id){m_id=id;}
105inline void EventParagraph::setPosition(uint64_t position){m_position=position;}
106inline void EventParagraph::setLength(uint64_t length){m_length=length;}
107}
108}
109}// namespace Lima
110#endif
This file is the main header file for the data related to annotation graphs.
#define LIMA_EVENTANALISYS_EXPORT
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, LinguisticVertexProperties > LinguisticGraph
Property to identify the chains in the graph.
Holds an annotation graph and gives an API to manipulate it.
a list of generic features: each feature is unique (only one feature for a name)
std::map< Common::MediaticData::EntityType, std::vector< Entity * > > getOtherEntities()
std::pair< Common::MediaticData::EntityType, std::vector< Entity * > > getEventEntities()
This class represents a list of elements, that are pointers on polymmorphic annotations that can be d...
Definition Paragraph.h:45
int main(int argc, char *argv[])
Definition main.cpp:14
NAUTITIA.