本文整理汇总了C++中AnnotationData::cloneAnnotations方法的典型用法代码示例。如果您正苦于以下问题:C++ AnnotationData::cloneAnnotations方法的具体用法?C++ AnnotationData::cloneAnnotations怎么用?C++ AnnotationData::cloneAnnotations使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnnotationData
的用法示例。
在下文中一共展示了AnnotationData::cloneAnnotations方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: operator
//.........这里部分代码省略.........
if (!matchItr->isKept())
{
if (keeping)
{
RecognizerMatch::const_iterator prevItr = matchItr - 1;
idiomPartBounds.second = prevItr->getVertex();
keeping = false;
#ifdef DEBUG_LP
LDEBUG << "adding " << idiomPartBounds.first << " -> " << idiomPartBounds.second << " in edgesToRemove";
#endif
edgesToRemove.insert(idiomPartBounds);
}
// duplicate this vertex
#ifdef DEBUG_LP
LDEBUG << "duplication of vertex " << matchItr->getVertex();;
#endif
Token* token=get(vertex_token,*graph.getGraph(),matchItr->getVertex());
MorphoSyntacticData* data =
new MorphoSyntacticData(*get(vertex_data,*graph.getGraph(),matchItr->getVertex()));
LinguisticGraphVertex dupVx = add_vertex(const_cast<LinguisticGraph&>(*graph.getGraph()));
put(vertex_token,const_cast<LinguisticGraph&>(*graph.getGraph()),dupVx,token);
put(vertex_data,const_cast<LinguisticGraph&>(*graph.getGraph()),dupVx,data);
idiomAlternative.push_back(dupVx);
AnnotationGraphVertex agv = annotationData->createAnnotationVertex();
annotationData->addMatching("AnalysisGraph", dupVx, "annot", agv);
annotationData->annotate(agv, Common::Misc::utf8stdstring2limastring("AnalysisGraph"), dupVx);
std::set< LinguisticGraphVertex > annotMatches =
annotationData->matches("AnalysisGraph",matchItr->getVertex(),"annot");
for (std::set< LinguisticGraphVertex >::const_iterator annotIt(annotMatches.begin());
annotIt != annotMatches.end(); annotIt++)
{
std::set< std::string > excepted;
excepted.insert("AnalysisGraph");
annotationData->cloneAnnotations(*annotIt, agv, excepted);
}
addedVertices.insert(dupVx);
// verticesToRemove.insert(matchItr->getVertex());
}
else
{
if (!keeping)
{
idiomPartBounds.first = matchItr->getVertex();
keeping = true;
}
#ifdef DEBUG_LP
LDEBUG << "kept vertex " << matchItr->getVertex();
#endif
if (matchItr->getVertex()==headVertex)
{
foundHead=true;
#ifdef DEBUG_LP
LDEBUG << "add head vertex " << idiomaticVertex;
#endif
idiomAlternative.push_back(idiomaticVertex);
}
}
}
if (!foundHead)
{
MORPHOLOGINIT;
LWARN << "head token has not been found in non contiguous expression. "
<< "Idiomatic token is placed first";
idiomAlternative.push_front(idiomaticVertex);
}
if (keeping)