LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
Event.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 Event.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 EVENT_H
20#define EVENT_H
21
22#include "EventAnalysisExport.h"
23#include "EventParagraph.h"
25
26#include <deque>
27#include <queue>
28#include <iostream>
29
30namespace Lima {
31namespace LinguisticProcessing
32{
33
34namespace EventAnalysis
35{
36
43class LIMA_EVENTANALISYS_EXPORT Event : public std::vector< EventParagraph* >
44{
45public:
46 Event();
47 virtual ~Event();
48
49 bool hasFragment() const;
50
51 void addParagraph(Paragraph *,bool,bool,Common::AnnotationGraphs::AnnotationData*, std::string graphId,LinguisticGraph* graph);
53 virtual void read(std::istream& file);
54 virtual void write(std::ostream& file) const;
56
57 std::string toString(std::string parentURI,uint64_t index) const;
58
59 void compute_entities_weight(std::map<Common::MediaticData::EntityType,unsigned short>,Common::AnnotationGraphs::AnnotationData*, std::string graphId);
60 friend LIMA_EVENTANALISYS_EXPORT std::ostream& operator << (std::ostream&, const Event&);
61
62 void compute_main_entities();
63
65
66 void setDate(std::pair<Common::MediaticData::EntityType,std::pair<std::string,LinguisticGraphVertex> >);
67
68 uint64_t get_weight() const;
69 void setWeight(uint64_t w) { m_entities_weight=w; }
70
71 void setMain();
72 bool getMain() const;
73
74 bool has_entity(Common::MediaticData::EntityType) const;
75private:
76 std::pair <Common::MediaticData::EntityType,std::pair<std::string,LinguisticGraphVertex> > m_date;
77 uint64_t m_entities_weight;
78 bool m_main;
79
80};
81//**********************************************************************
82// inline functions
83// **********************************************************************
84
85inline void Event::setMain()
86{
87 m_main=true;
88}
89
90inline bool Event::getMain() const
91{
92 return m_main;
93}
94inline uint64_t Event::get_weight() const
95{
96 return m_entities_weight;
97}
98
99inline void Event::setDate(std::pair<Common::MediaticData::EntityType,std::pair<std::string,LinguisticGraphVertex> > date){m_date=date;}
100
101inline bool Event::hasFragment() const { return (!empty()); }
102
103
104}
105}
106}// namespace Lima
107#endif
This file is the main header file for the data related to annotation graphs.
#define LIMA_EVENTANALISYS_EXPORT
QDebug & operator<<(QDebug &qd, const std::string &str)
Definition QsLog.cpp:39
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.
This class represents a list of elements, that are pointers on polymmorphic annotations that can be d...
Definition Event.h:44
void setDate(std::pair< Common::MediaticData::EntityType, std::pair< std::string, LinguisticGraphVertex > >)
Definition Event.h:99
This class represents a list of elements, that are pointers on polymmorphic annotations that can be d...
Definition Paragraph.h:45
NAUTITIA.