30namespace LinguisticProcessing
33namespace EventAnalysis
43 LDEBUG <<
"Nouvel évènement";
48 for(std::vector< EventParagraph* >::const_iterator iT=begin(); iT !=end(); iT++)
61 for(std::vector<EventParagraph*>::const_iterator iT=begin();iT!=end();iT++)
63 std::pair<Common::MediaticData::EntityType,std::vector<Entity *> >
event=(*iT)->getEventEntities();
64 std::map<Common::MediaticData::EntityType,std::vector<Entity *> > otherentities=(*iT)->getOtherEntities();
65 std::vector<Entity *> v_entity =
event.second;
66 if(v_entity.size() > 0)
68 Entity *entity = v_entity[0];
73 v_entity = (*iT).second;
74 if(v_entity.size() > 0)
76 Entity *entity = v_entity[0];
91 for(std::map<Common::MediaticData::EntityType,unsigned short>::iterator iT=map_weights.begin();iT!=map_weights.end();iT++)
93 if (
has_entity((*iT).first)) m_entities_weight=m_entities_weight+(*iT).second;
96 LDEBUG <<
"computed entities_weight of event = " << m_entities_weight;
103 if (t==m_date.first)
return true;
105 for(std::vector<EventParagraph*>::const_iterator iT=begin();iT!=end() && !res;iT++)
107 res=(*iT)->has_entity(t);
115 std::set< AnnotationGraphVertex > matches = annotationData->
matches(graphId,v,
"annot");
116 for (std::set< AnnotationGraphVertex >::const_iterator it = matches.begin();
117 it != matches.end(); it++)
133 LDEBUG <<
"Ajout de Paragraph";
136 if (this->size()==0) push_back(ep);
142 LDEBUG <<
"Les deux paragraphes sont contigus";
149 lastp->
addEntities(p,annotationData,graphId,graph);
151 this->push_back(lastp);
158 LDEBUG <<
"Les deux paragraphes appartiennent à des sections différentes";
180 LDEBUG <<
" Read Main = " << m_main;
181 LDEBUG <<
" Read size of fragments " << size;
182 for (uint64_t i(0); i<size; i++) {
191 LDEBUG <<
"Event::write()..";
195 LDEBUG <<
" Write size of fragments " << size();
196 for (std::vector< EventParagraph* >::const_iterator iT=begin(); iT!=end(); iT++) {
205 for (std::vector< EventParagraph* >::const_iterator iT=begin(); iT!=end(); iT++) {
206 out.append((*iT)->toString(parentURI, index, m_main));
213 for (Event::const_iterator i(text.begin());
214 i != text.end(); i++) {
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, LinguisticVertexProperties > LinguisticGraph
Property to identify the chains in the graph.
#define EVENTANALYZERLOGINIT
#define EVENTANALYSISLOGINIT
Holds an annotation graph and gives an API to manipulate it.
std::set< AnnotationGraphVertex > matches(const std::string &first, AnnotationGraphVertex firstVx, const std::string &second) const
Gets the set of vertices matched in the second graph by the given vertex of the first graph.
const GenericAnnotation & annotation(AnnotationGraphVertex v1, AnnotationGraphVertex v2, const LimaString &annot) const
void setLength(uint64_t length)
uint64_t getLength() const
virtual void read(std::istream &file)
void addEntities(Paragraph *p, Common::AnnotationGraphs::AnnotationData *, std::string graphId, LinguisticGraph *graph)
void addEventEntities(Paragraph *p, Common::AnnotationGraphs::AnnotationData *, std::string graphId, LinguisticGraph *graph)
This class represents a list of elements, that are pointers on polymmorphic annotations that can be d...
bool has_entity(Common::MediaticData::EntityType) const
void compute_main_entities()
void addParagraph(Paragraph *, bool, bool, Common::AnnotationGraphs::AnnotationData *, std::string graphId, LinguisticGraph *graph)
virtual void write(std::ostream &file) const
void compute_entities_weight(std::map< Common::MediaticData::EntityType, unsigned short >, Common::AnnotationGraphs::AnnotationData *, std::string graphId)
Common::MediaticData::EntityType getEntityType(LinguisticGraphVertex, Common::AnnotationGraphs::AnnotationData *, std::string graphId) const
virtual void read(std::istream &file)
std::string toString(std::string parentURI, uint64_t index) const
This class represents a list of elements, that are pointers on polymmorphic annotations that can be d...
AnnotationGraph::vertex_descriptor AnnotationGraphVertex
bool hasAnnotation(AnnotationGraphVertex v, const LimaString &annot) const
uint64_t readCodedInt(std::istream &file)
read a integer coded in variable-byte format in a file
void writeCodedInt(std::ostream &file, const uint64_t number)
write a integer coded in variable-byte format in a file
LimaString utf8stdstring2limastring(const std::string &src)
std::ostream & operator<<(std::ostream &os, const Entity &annot)