36namespace LinguisticProcessing {
37namespace EventAnalysis {
72 auto eventData = std::dynamic_pointer_cast<EventTemplateData>(analysis.
getData(
"EventTemplateData"));
74 eventData = std::make_shared<EventTemplateData>();
75 analysis.
setData(
"EventTemplateData", eventData);
78 unsigned int cardinality(1);
79 auto defData = std::dynamic_pointer_cast<EventTemplateDefinitionData>(analysis.
getData(
"EventTemplateFillingTemplateDefinition"));
81 LDEBUG <<
"AddTemplateElement: no template definition provided";
84 cardinality=defData->resource->getCardinality(m_role);
89 LDEBUG <<
"AddTemplateElement("<< m_type <<
"): add " << elt <<
" as " << m_role <<
", cardinality =" << cardinality;
90 eventData->addElementInCurrentTemplate(m_role,elt,cardinality);
94 const auto annotationData = std::dynamic_pointer_cast< AnnotationData >(analysis.
getData(
"AnnotationData"));
95 if (annotationData==0)
98 LERROR <<
"AddTemplateElement: no annotation graph available !";
102 std::set< AnnotationGraphVertex > matches = annotationData->matches(graph.
getGraphId(),v,
"annot");
103 for (std::set< AnnotationGraphVertex >::const_iterator it = matches.begin();
104 it != matches.end(); it++)
111 pointerValue<SpecificEntityAnnotation>();
114 LDEBUG <<
"AddTemplateElement: add " << elt <<
" as " << m_role <<
", cardinality =" << cardinality;
115 eventData->addElementInCurrentTemplate(m_role,elt,cardinality);
128 LERROR <<
"Calling constraint AddTemplateElement with two vertices: not implemented yet";
139 LDEBUG <<
"Complement" << complement;
141 LDEBUG <<
"m_event_type" << m_eventType;
146 auto eventData = std::dynamic_pointer_cast<EventTemplateData>(analysis.
getData(
"EventTemplateData"));
149 LERROR <<
"CreateEventTemplate: Missing data EventTemplateData";
153 LDEBUG <<
"CreateEventTemplate";
156 LDEBUG <<
"setTypeInCurrentTemplate" << m_eventType;
157 eventData->setTypeInCurrentTemplate(m_eventType);
159 eventData->addTemplate();
172 auto eventData = std::dynamic_pointer_cast<EventTemplateData>(analysis.
getData(
"EventTemplateData"));
175 LERROR <<
"CreateEventTemplate: Missing data EventTemplateData";
179 LDEBUG <<
"ClearEventTemplate";
180 eventData->clearCurrentTemplate();
#define CreateEventTemplateId
#define ClearEventTemplateId
#define AddTemplateElementId
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
#define EVENTANALYSISLOGINIT
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.
␈rief A class for the description of automata
bool operator()(const LinguisticAnalysisStructure::AnalysisGraph &graph, const LinguisticGraphVertex &v, AnalysisContent &analysis) const override
unary constraint function : the constraint only applies on one vertices in the graph (the graph is al...
AddTemplateElement(MediaId language, const LimaString &complement)
ClearEventTemplate(MediaId language, const LimaString &complement)
bool operator()(AnalysisContent &analysis) const override
zero-ary constraint function : applies the function without a vertex indication (used for actions,...
bool operator()(AnalysisContent &analysis) const override
zero-ary constraint function : applies the function without a vertex indication (used for actions,...
CreateEventTemplate(MediaId language, const LimaString &complement)
An AnalysisData containing a LinguisticGraph with a language and an id.
const std::string & getGraphId(void) const
A representation of a specific entity to store in the annotation graph.
Common::MediaticData::EntityType getType() const
static const MediaticData & single()
const singleton accessor
AnnotationGraph::vertex_descriptor AnnotationGraphVertex
std::string limastring2utf8stdstring(const Lima::LimaString &phrase, uint32_t size0)
Convert a wide string to a string , in dest up to size bytes.
LimaString utf8stdstring2limastring(const std::string &src)
ConstraintFunctionFactory< AddTemplateElement > AddTemplateElementFactory(AddTemplateElementId)
ConstraintFunctionFactory< CreateEventTemplate > CreateEventTemplateFactory(CreateEventTemplateId)
ConstraintFunctionFactory< ClearEventTemplate > ClearEventTemplateFactory(ClearEventTemplateId)
launch exception related to the configuration file parsing