LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
EventSegmentation.cpp
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
16#include "EventSegmentation.h"
17#include "Events.h"
18
19
21
26
27#include <iostream>
28#include <queue>
29
30
31using namespace std;
32//using namespace boost;
33using namespace boost::tuples;
34
35using namespace Lima::Common::Misc;
36using namespace Lima::Common::MediaticData;
37using namespace Lima::Common::AnnotationGraphs;
38using namespace Lima::LinguisticProcessing;
42
43
44namespace Lima
45{
46namespace LinguisticProcessing
47{
48namespace EventAnalysis
49{
51
52
53
55m_graphId("PosGraph"),
56m_language(),
57m_dateEntity(),
58m_eventEntity(),
59m_set_otherentities(),
60m_entitiesWeights(),
61map_paragraphs()
62{}
63
64
67 Manager* manager)
68
69{
71 m_language=manager->getInitializationParameters().media;
72 try
73 {
74 m_graphId=unitConfiguration.getParamsValueAtKey("graph");
75 }
77 {
78
79 } // use default value Posgraph
80
81 try
82 {
83 string dateEntity=unitConfiguration.getParamsValueAtKey("DateEntity");
85 }
87 {
88 LERROR << "No DateEntity defined in "<<unitConfiguration.getName()<<" configuration group for language " << m_language;
89 }
90 try
91 {
92 string eventEntity=unitConfiguration.getParamsValueAtKey("EventEntity");
94 }
96 {
97 LERROR << "No EventEntity defined in "<<unitConfiguration.getName()<<" configuration group for language " << m_language;
98 }
99 try
100 {
101 deque<string> otherEntities = unitConfiguration.getListsValueAtKey("OtherEntities");
102 for(deque<string>::iterator itr=otherEntities.begin();itr !=otherEntities.end();itr++)
103 {
105 }
106 }
108 {
109 LERROR << "No OtherEntities defined in "<<unitConfiguration.getName()<<" configuration group for language " << m_language;
110 }
111 try
112 {
113 std::map<std::string,std::string>& weights=unitConfiguration.getMapAtKey("EntitiesWeights");
114 LDEBUG << "Weights map size =" << weights.size();
115 for (std::map<std::string,std::string>::const_iterator it=weights.begin();
116 it!=weights.end();
117 it++)
118 {
119 LDEBUG << "Init EntitiesWeights entityType=" << Common::MediaticData::MediaticData::single().getEntityType(Common::Misc::utf8stdstring2limastring(it->first)) << " , weight " << atoi((it->second).c_str());
120 m_entitiesWeights[Common::MediaticData::MediaticData::single().getEntityType(Common::Misc::utf8stdstring2limastring(it->first))]=atoi((it->second).c_str());
121
122 }
123 }
125 {
126 LERROR << "No map 'EntitiesWeigths' in "<<unitConfiguration.getName()<<" configuration group for language " << m_language;
127
128 }
129}
130
137 AnalysisContent& analysis) const
138{
141 LDEBUG << "start EventSegmentation";
142
143 // ici normalement on peut prendre soit analysis graph soit le prostgraph, cela doit être paramétré
144 auto anagraph = std::dynamic_pointer_cast<AnalysisGraph>(analysis.getData(m_graphId));
145 if (anagraph==0)
146 {
147 LERROR << "no "<< m_graphId << " ! abort";
148 return MISSING_DATA;
149 }
150 auto annotationData = std::dynamic_pointer_cast< AnnotationData >(analysis.getData("AnnotationData"));
151 if (annotationData==0)
152 {
153 LERROR << "no AnnotationData ! abort";
154 return MISSING_DATA;
155 }
156 auto sb = std::dynamic_pointer_cast<SegmentationData>(analysis.getData("SentenceBoundaries"));
157 if (sb==0)
158 {
159 LERROR << "no SentenceBoundaries ! abort";
160 return MISSING_DATA;
161 }
162 auto pb = std::dynamic_pointer_cast<SegmentationData>(analysis.getData("ParagraphBoundaries"));
163 if (pb==0)
164 {
165 LERROR << "no ParagraphBoundaries ! abort";
166 return MISSING_DATA;
167 }
168
169 std::vector<Paragraph*> v_paragraph;
170 compute_paragraphs(v_paragraph,anagraph->getGraph(),anagraph.get(),sb.get(), pb.get(), annotationData.get());
171
172 std::map<std::string,Event*> map_event;
173 compute_events(map_event,v_paragraph,anagraph->getGraph(),annotationData.get(),m_graphId);
174
175 Events* eventData=new Events();
176
177 // Computes entities weight of events
178 uint64_t max_weight=0;
179 Event* main_event=0;
180 for (std::map<std::string,Event*>::const_iterator iT=map_event.begin();iT!=map_event.end();iT++)
181 {
182 (*iT).second->compute_entities_weight(m_entitiesWeights, annotationData.get(), m_graphId);
183 if ((*iT).second->get_weight() > max_weight)
184 {
185 max_weight=(*iT).second->get_weight();
186 main_event=(*iT).second;
187 }
188
189 eventData->push_back((*iT).second);
190 }
191 LDEBUG << "Le nombre d'évènements différents est égal à = " << map_event.size();
192
193 if (main_event!=0)
194 {
195 LDEBUG << "Le meilleur poids est égal à = " << max_weight;
196 main_event->setMain();
197 }
198
199 // store only segmentation in segmentationData
200 SegmentationData* segmData=new SegmentationData(m_graphId);
201
202 for (Events::const_iterator it=eventData->begin(),it_end=eventData->end();it!=it_end;it++) {
203 Event* event=(*it);
204 string type;
205 if (event->getMain()) {
206 type="MAIN_EVENT";
207 }
208 else {
209 type="SUB_EVENT";
210 }
211 for (Event::const_iterator it2=event->begin(),it2_end=event->end();it2!=it2_end;it2++) {
212 EventParagraph* par=(*it2);
213 Segment s(type);
214 s.setVerticesFromPositions(par->getPosition(),par->getLength(),anagraph.get());
215 segmData->add(s);
216 }
217 }
218 analysis.setData("EventSegmentationData",segmData);
219
220 TimeUtils::logElapsedTime("EventSegmentation");
221 return SUCCESS_ID;
222}
223
224void EventSegmentation::compute_events(std::map<std::string,Event*>& map_event, std::vector<Paragraph*> v_par,LinguisticGraph* graph,Common::AnnotationGraphs::AnnotationData* annotationData, std::string graphId) const
225{
227
228
229 for (uint64_t i=0; i<v_par.size();i++)
230 {
231 Paragraph *p=v_par[i];
232
233
234 if (p->toFilter() || (p->getDatesSize()==0))
235 {
236 // ignorer le paragraphe complètement et le supprimer
237 delete(v_par[i]);
238 LDEBUG << "Paragraph numéro : " << (i+1) << " a filtrer ";
239 }
240 else
241 {
242 LDEBUG << "Paragraph numéro : " << (i+1) << " a étudier ayant comme nombre de date = " << p->getDatesSize();
243 // Il faut juste ajouter le paragraphe dans l'évènement concerné
244 if (p->getDatesSize()==1)
245 {
246 LDEBUG << " La date est " << p->getDate().first;
247 std::pair<string,LinguisticGraphVertex> date=p->getDate();
248 if (map_event.find(date.first)!=map_event.end())
249 {
250 Event *ev=map_event[date.first];
251 ev->addParagraph(p,true,false,annotationData,graphId,graph);
252 map_event[date.first]=ev;
253 }
254 else
255 {
256 Event *ev=new Event();
257 ev->setDate(make_pair(m_dateEntity,date));
258 LDEBUG << "Creation d'un nouvel évènement ";
259 ev->addParagraph(p,true,false,annotationData,graphId,graph);
260 map_event[date.first]=ev;
261 }
262 }
263 else // Cas complexe
264 {
265 bool first_time=true;
266 while(p->getDatesSize()>1)
267 {
268 Paragraph *p1 =new Paragraph();
269 p1->setPosition(p->getPosition());
270 std::pair<std::string,LinguisticGraphVertex> date1=p->extractDate();
271 std::pair<std::string,LinguisticGraphVertex> date2=p->getDate();
272 Token *t_date2=get(vertex_token,*graph,date2.second);
273 p1->setPosition(p->getPosition());
274 p1->addDate(date1.first,date1.second);
275 LinguisticGraphVertex split=date2.second;
276 bool end=(p->getSentencesSize()==0);
277 while(!end)
278 {
280 Token *t_sentence=get(vertex_token,*graph,sentence);
281 if(t_sentence->position() < t_date2->position())
282 split=sentence;
283 else
284 {
285 p->addSentence(sentence);
286 end=true;
287 }
288 }
289
290 Token *t_split=get(vertex_token,*graph,split);
291 p1->setLength(t_split->position()-p->getPosition());
292 p->setPosition(t_split->position());
293 p->setLength(p->getLength()-p1->getLength());
294
295 std::map<Common::MediaticData::EntityType, std::deque<LinguisticGraphVertex> > entities = p->extractEntitiesBeforeVertex(split,graph);
296
297 std::pair<Common::MediaticData::EntityType, std::deque<LinguisticGraphVertex> > evententities = p->extractEventEntitiesBeforeVertex(split,graph);
298
299 LDEBUG << "EventSegmentation evententities type " << evententities.first;
300 p1->addEventEntities(evententities);
302
303 if (p1->toFilter())
304 {
305 delete(p1);
306 }
307 else
308 {
309 std::pair<string,LinguisticGraphVertex> date=p1->getDate();
310 if (map_event.find(date.first)!=map_event.end())
311 {
312 Event *ev=map_event[date.first];
313 ev->addParagraph(p1,first_time,true,annotationData,graphId,graph);
314 map_event[date.first]=ev;
315 }
316 else
317 {
318 Event *ev=new Event();
319 ev->setDate(make_pair(m_dateEntity,date));
320 LDEBUG << "Creation d'un nouvel évènement ";
321 ev->addParagraph(p1,first_time,true,annotationData,graphId,graph);
322 map_event[date.first]=ev;
323 }
324 }
325 first_time=false;
326 }// end while
327 // traiter la dernière date
328 if (p->toFilter())
329 {
330 delete(p);
331 }
332 else{
333 std::pair<string,LinguisticGraphVertex> date=p->getDate();
334 if (map_event.find(date.first)!=map_event.end())
335 {
336 Event *ev=map_event[date.first];
337 ev->addParagraph(p,false,false,annotationData,graphId,graph);
338 map_event[date.first]=ev;
339 }
340 else
341 {
342 Event *ev=new Event();
343 ev->setDate(make_pair(m_dateEntity,date));
344 LDEBUG << "Creation d'un nouvel évènement ";
345 ev->addParagraph(p,false,false,annotationData,graphId,graph);
346 map_event[date.first]=ev;
347 }
348 }
349 }
350 }
351 }
352}
353
354void EventSegmentation::compute_paragraphs(std::vector<Paragraph*>& v_par,
355 LinguisticGraph* graph,
356 AnalysisGraph* anagraph,
358 SegmentationData* pb,
359 Common::AnnotationGraphs::AnnotationData* annotationData) const
360{
362
363
364// LinguisticGraphVertex v;
365
366 const LinguisticGraphVertex firstVx = anagraph->firstVertex();
367 const LinguisticGraphVertex lastVx = anagraph->lastVertex();
368
369 std::set<LinguisticGraphVertex> visited;
370 std::queue<LinguisticGraphVertex> toVisit;
371 toVisit.push(firstVx);
372
373 LinguisticGraphOutEdgeIt outItr,outItrEnd;
374
375 Paragraph *p=new Paragraph();
376 uint64_t id_paragraph=1;
377 p->setId(id_paragraph);
378
379 Token* token=0;
380 Token* previous_token=0;
381 uint64_t position;
382// uint64_t length=0;
383
384 v_par.push_back(p);
385 std::string current_date= "00-00-00";
386
387 while (!toVisit.empty())
388 {
389 LinguisticGraphVertex v=toVisit.front();
390 toVisit.pop();
391 if (v != lastVx) {
392
393
394 for (boost::tie(outItr,outItrEnd)=out_edges(v,*graph);
395 outItr!=outItrEnd;
396 outItr++)
397 {
398 LinguisticGraphVertex next=target(*outItr,*graph);
399 if (visited.find(next)==visited.end())
400 {
401 visited.insert(next);
402 toVisit.push(next);
403 }
404 }
405 }
406 if (v != firstVx && v != lastVx)
407 {
408 LDEBUG << "Traitement du vertex " << v;
409 LDEBUG << "current_date du vertex " << current_date;
410 token = get(vertex_token, *graph, v);
411 // it is a vertex of a new paragraph
412 if(is_a_bound(v,pb) )
413 {
414
415 LDEBUG << "Je suis dans le Début d'un nouveau paragraphe ";
416 current_date= "00-00-00";
417 // créer la map du vertex
418 uint64_t par_position=v_par[v_par.size()-1]->getPosition();
419 uint64_t last_position=previous_token->position()+previous_token->length()-1;
420 v_par[v_par.size()-1]->setLength(last_position-par_position+1);
421
422 position= token->position();
423 v_par.push_back(new Paragraph());
424 id_paragraph++;
425 v_par[v_par.size()-1]->setId(id_paragraph);
426 v_par[v_par.size()-1]->setPosition(position);
427 }
428
429 if (is_specific_entity(v,annotationData))
430 {
431 LDEBUG << "Je suis dans un vertex de type Entité nommée ";
432 // verify if it is a date
433 if(is_specific_entity(v,annotationData,m_dateEntity))
434 {
435 string date= getDate(v,annotationData,m_dateEntity);
436 LDEBUG << "Je suis dans Date ";
437 LDEBUG << "Valeur de la Date =" << date;
438 if (date.compare("00-00-00")==0)
439 {
440 // ignorer la date
441 LDEBUG << "Date mal normalisée à ignorer";
442 }
443 else
444 {
445 v_par[v_par.size()-1]->addDate(date,v);
446 current_date=date;
447 }
448 }
449 // verify if it is a event
450 else if(is_specific_entity(v,annotationData,m_eventEntity))
451 {
452 // mettre l'entités nommées dans le bon para
453 LDEBUG << "Je suis dans Evenement ";
454 v_par[v_par.size()-1]->addEventEntity(m_eventEntity,v);
455 }
456 // verify if it is is the set of entities domain
457 else if(is_specific_entity_in(v,annotationData,m_set_otherentities))
458 {
459 // mettre l'entités nommées dans le bon para
460 LDEBUG << "Je suis dans les autres types d'EN ";
461 Common::MediaticData::EntityType e =getEntityType(v,annotationData,m_graphId);
462 v_par[v_par.size()-1]->addEntity(e,v);
463 }
464 //ignore if it is a another type of entity
465 }
466
467 // it is the last position of the current sentence
468 else if (is_a_bound(v,sb))
469 {
470 LDEBUG << "Je suis dans fin d'une phrase ";
471 // ajouter la position de la phrase dans le paragraphe
472 v_par[v_par.size()-1]->addSentence(v);
473 }
474 }
475 else
476 {
477 if (v == lastVx)
478 {
479 uint64_t par_position=v_par[v_par.size()-1]->getPosition();
480 uint64_t last_position=previous_token->position()+previous_token->length()-1;
481 v_par[v_par.size()-1]->setLength(last_position-par_position+1);
482 LDEBUG << "par_position " << par_position << ", last_position" << last_position;
483
484 }
485 }
486 previous_token=token;
487 }
488
489}
490
491
493{
494// ??OME2 for (SegmentationData::const_iterator it=tb->begin(),it_end=tb->end();
495 for (std::vector<Segment>::const_iterator it=(tb->getSegments()).begin(),it_end=(tb->getSegments()).end();
496 it!=it_end; it++)
497 {
498 if ((*it).getLastVertex() == v) return true;
499 }
500 return false;
501}
502
504{
505// EVENTANALYZERLOGINIT;
506 std::set< AnnotationGraphVertex > matches = annotationData->matches(m_graphId,v,"annot");
507 for (std::set< AnnotationGraphVertex >::const_iterator it = matches.begin();
508 it != matches.end(); it++)
509 {
510// AnnotationGraphVertex vx=*it;
511 //LDEBUG << "Looking at annotation graph vertex " << vx;
512
513 if (annotationData->hasAnnotation(*it, Common::Misc::utf8stdstring2limastring("SpecificEntity")))
514 {
515 return true;
516 }
517 }
518 return false;
519}
520
522{
524 std::set< AnnotationGraphVertex > matches = annotationData->matches(m_graphId,v,"annot");
525 for (std::set< AnnotationGraphVertex >::const_iterator it = matches.begin();
526 it != matches.end(); it++)
527 {
529 LDEBUG << "Looking at annotation graph vertex " << vx;
530
531 if (annotationData->hasAnnotation(vx, Common::Misc::utf8stdstring2limastring("SpecificEntity")))
532 {
533 EntityType e;
534 e=annotationData->annotation(vx,Common::Misc::utf8stdstring2limastring("SpecificEntity")).pointerValue< SpecificEntityAnnotation>()->getType();
535 if (e==t) return true;
536 }
537 }
538 return false;
539}
540
542{
544 std::set< AnnotationGraphVertex > matches = annotationData->matches(graphId,v,"annot");
545 for (std::set< AnnotationGraphVertex >::const_iterator it = matches.begin();
546 it != matches.end(); it++)
547 {
549
550 if (annotationData->hasAnnotation(vx, Common::Misc::utf8stdstring2limastring("SpecificEntity")))
551 {
552
553 e=annotationData->annotation(vx,Common::Misc::utf8stdstring2limastring("SpecificEntity")).pointerValue< SpecificEntityAnnotation>()->getType();
554 return e;
555 }
556 }
557 return e;
558}
559
561{
563 std::string normalizedForm="00-00-00";
564 std::string year="00";
565 std::string month="00";
566 std::string day="00";
567
568 std::set< AnnotationGraphVertex > matches = annotationData->matches(m_graphId,v,"annot");
569 for (std::set< AnnotationGraphVertex >::const_iterator it = matches.begin();
570 it != matches.end(); it++)
571 {
573 LDEBUG << "Looking at annotation graph vertex " << vx;
574
575 if (annotationData->hasAnnotation(vx, Common::Misc::utf8stdstring2limastring("SpecificEntity")))
576 {
577
578
579 EntityType e;
580 e=annotationData->annotation(vx,Common::Misc::utf8stdstring2limastring("SpecificEntity")).pointerValue< SpecificEntityAnnotation>()->getType();
581 if (e == t)
582 {
583 EntityFeatures features;
584 features=annotationData->annotation(vx,Common::Misc::utf8stdstring2limastring("SpecificEntity")).pointerValue< SpecificEntityAnnotation>()->getFeatures();
585 for (Automaton::EntityFeatures::const_iterator
586 featureItr=features.begin(),features_end=features.end();
587 featureItr!=features_end; featureItr++)
588 {
589 LDEBUG << "Looking for feature=" << featureItr->getName() << ", value=" << featureItr->getValueString();
590 if (featureItr->getName().compare("date") == 0)
591 return (featureItr->getValueString());
592 if (featureItr->getName().compare("year") == 0)
593 year=featureItr->getValueString();
594 if (featureItr->getName().compare("month") == 0)
595 month=featureItr->getValueString();
596 if (featureItr->getName().compare("day") == 0)
597 day=featureItr->getValueString();
598 }
599 }
600 }
601 }
602 normalizedForm= year;
603 normalizedForm.insert(normalizedForm.end(),'-');
604 normalizedForm.append(month);
605 normalizedForm.insert(normalizedForm.end(),'-');
606 normalizedForm.append(day);
607 LDEBUG << "Returned normalizedForm = " << normalizedForm;
608 return (normalizedForm);
609}
610
611bool EventSegmentation::is_specific_entity_in(LinguisticGraphVertex v,AnnotationData* annotationData,set<EntityType> eset) const
612{
614 std::set< AnnotationGraphVertex > matches = annotationData->matches(m_graphId,v,"annot");
615 for (std::set< AnnotationGraphVertex >::const_iterator it = matches.begin();
616 it != matches.end(); it++)
617 {
619 LDEBUG << "Looking at annotation graph vertex " << vx;
620
621 if (annotationData->hasAnnotation(vx, Common::Misc::utf8stdstring2limastring("SpecificEntity")))
622 {
623 EntityType e;
624 e=annotationData->annotation(vx,Common::Misc::utf8stdstring2limastring("SpecificEntity")).pointerValue< SpecificEntityAnnotation>()->getType();
625 if (eset.find(e)!=eset.end()) return true;
626 }
627 }
628 return false;
629}
630
631} // closing namespace EventAnalysis
632} // closing namespace LinguisticProcessing
633} // closing namespace Lima
#define EVENTSEGMENTATION_CLASSID
#define LDEBUG
Definition LimaCommon.h:157
#define LERROR
Definition LimaCommon.h:161
@ vertex_token
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
LinguisticGraph::out_edge_iterator LinguisticGraphOutEdgeIt
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, LinguisticVertexProperties > LinguisticGraph
Property to identify the chains in the graph.
#define EVENTANALYZERLOGINIT
Defines a Factory to create Object of type Base.
Holds all data that pass through the ProcessUnits Analysis data are shared pointers,...
std::shared_ptr< AnalysisData > getData(const QString &id)
return AnalysisData by id
void setData(const QString &id, std::shared_ptr< AnalysisData > data)
set an analysisData with the given id.
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
EntityType getEntityType(const LimaString &entityName) const
entity types manager
std::deque< std::string > & getListsValueAtKey(const std::string &key)
std::map< std::string, std::string > & getMapAtKey(const std::string &key)
return a message when a 'param' was not found
Manage initialization of InitializableObjects using configuration module and parameters.
const InitializationParameters & getInitializationParameters() const
get Initialization Parameters
a list of generic features: each feature is unique (only one feature for a name)
bool is_specific_entity_in(LinguisticGraphVertex, Common::AnnotationGraphs::AnnotationData *, std::set< Common::MediaticData::EntityType >) const
bool is_a_bound(LinguisticGraphVertex, SegmentationData *) const
void compute_paragraphs(std::vector< Paragraph * > &, LinguisticGraph *, LinguisticAnalysisStructure::AnalysisGraph *, SegmentationData *, SegmentationData *, Common::AnnotationGraphs::AnnotationData *) const
std::string getDate(LinguisticGraphVertex, Common::AnnotationGraphs::AnnotationData *, Common::MediaticData::EntityType) const
bool is_specific_entity(LinguisticGraphVertex, Common::AnnotationGraphs::AnnotationData *) const
void init(Common::XMLConfigurationFiles::GroupConfigurationStructure &unitConfiguration, Manager *manager) override
initialize with parameters from configuration file.
LimaStatusCode process(AnalysisContent &analysis) const override
void compute_events(std::map< std::string, Event * > &, std::vector< Paragraph * >, LinguisticGraph *, Common::AnnotationGraphs::AnnotationData *, std::string) const
Common::MediaticData::EntityType getEntityType(LinguisticGraphVertex, Common::AnnotationGraphs::AnnotationData *, std::string graphId) const
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
void addParagraph(Paragraph *, bool, bool, Common::AnnotationGraphs::AnnotationData *, std::string graphId, LinguisticGraph *graph)
Definition Event.cpp:130
void compute_entities_weight(std::map< Common::MediaticData::EntityType, unsigned short >, Common::AnnotationGraphs::AnnotationData *, std::string graphId)
Definition Event.cpp:83
This class represents a list of elements, that are pointers on polymmorphic annotations that can be d...
Definition Paragraph.h:45
std::pair< std::string, LinguisticGraphVertex > extractDate()
Definition Paragraph.h:104
std::map< Common::MediaticData::EntityType, std::deque< LinguisticGraphVertex > > extractEntitiesBeforeVertex(LinguisticGraphVertex v, LinguisticGraph *graph)
Definition Paragraph.cpp:90
std::pair< std::string, LinguisticGraphVertex > getDate()
Definition Paragraph.h:99
std::pair< Common::MediaticData::EntityType, std::deque< LinguisticGraphVertex > > extractEventEntitiesBeforeVertex(LinguisticGraphVertex v, LinguisticGraph *graph)
Definition Paragraph.cpp:51
void addDate(std::string, LinguisticGraphVertex)
Definition Paragraph.h:174
An AnalysisData containing a LinguisticGraph with a language and an id.
const LinguisticGraphVertex & lastVertex(void) const
Returns the last vertex of the graph.
const LinguisticGraphVertex & firstVertex(void) const
Returns the first vertex of the graph.
void setVerticesFromPositions(uint64_t posBegin, uint64_t length, LinguisticAnalysisStructure::AnalysisGraph *anagraph)
const std::vector< Segment > & getSegments() const
static const MediaticData & single()
const singleton accessor
Definition Singleton.h:51
static void logElapsedTime(const std::string &mess, const std::string &taskCategory=std::string(""))
log the number of microseconds since last UpdateCurrentTime
static void updateCurrentTime(const std::string &taskCategory=std::string(""))
store current time for new elapsed time computation
AnnotationGraph::vertex_descriptor AnnotationGraphVertex
bool hasAnnotation(AnnotationGraphVertex v, const LimaString &annot) const
LimaString utf8stdstring2limastring(const std::string &src)
SimpleFactory< MediaProcessUnit, EventSegmentation > EventSegmentationFactory(EVENTSEGMENTATION_CLASSID)
NAUTITIA.
LimaStatusCode
Definition LimaCommon.h:236
@ SUCCESS_ID
Definition LimaCommon.h:237
@ MISSING_DATA
Definition LimaCommon.h:243
STL namespace.
static const struct TextHtmlEntity entities[]