85 auto annotationData = std::dynamic_pointer_cast< AnnotationData >(analysis.
getData(
"AnnotationData"));
87 if (annotationData->dumpFunction(
"SemanticRelation") == 0)
89 annotationData->dumpFunction(
"SemanticRelation",
92 auto recoData = std::dynamic_pointer_cast<RecognizerData>(analysis.
getData(
"RecognizerData"));
94 for (
auto i = m_relations.begin(); i != m_relations.end(); i++)
99 auto matchesVtx1 = annotationData->matches(recoData->getGraphId(),
102 auto matchesVtx2 = annotationData->matches(recoData->getGraphId(),
106 if (!annotationData->hasAnnotation(*(matchesVtx1.begin()),
107 *(matchesVtx2.begin()),
112 annotationData->annotate(*(matchesVtx1.begin()),
113 *(matchesVtx2.begin()),
119 auto annot = annotationData->annotation(*(matchesVtx1.begin()),
120 *(matchesVtx2.begin()),
123 LWARN <<
"SemanticRelationData::addRelations There is already a SemanticRelation between"
124 << *(matchesVtx1.begin()) <<
"and" << *(matchesVtx2.begin()) << annot->
type();
125 LWARN <<
"Adding new type" << i->get<2>();
126 QString type = QString::fromUtf8(annot->type().c_str());
127 QStringList typeList = type.split(
',');
128 typeList << i->get<2>().c_str();
130 typeList.removeDuplicates();
131 annot->type(typeList.join(
',').toUtf8().constData());
132 LWARN <<
"Adding type is now" << annot->type();
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