本文整理汇总了C++中AnnotationData::intAnnotation方法的典型用法代码示例。如果您正苦于以下问题:C++ AnnotationData::intAnnotation方法的具体用法?C++ AnnotationData::intAnnotation怎么用?C++ AnnotationData::intAnnotation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnnotationData
的用法示例。
在下文中一共展示了AnnotationData::intAnnotation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: process
//.........这里部分代码省略.........
out << "<entities docid=\"" << docId
<< "\" offsetNode=\"" << offsetIndexingNode
<< "\" offset=\"" << offset
<< "\">" << endl;
}
else {
out << "<specific_entities>" << endl;
}
// SELOGINIT;
if (m_followGraph) {
// instead of looking to all annotations, follow the graph (in
// morphological graph, some vertices are not related to main graph:
// idiomatic expressions parts and named entity parts)
// -> this will not include nested entities
AnalysisGraph* tokenList=static_cast<AnalysisGraph*>(analysis.getData(m_graph));
if (tokenList==0) {
LERROR << "graph " << m_graph << " has not been produced: check pipeline";
return MISSING_DATA;
}
LinguisticGraph* graph=tokenList->getGraph();
//const FsaStringsPool& sp=Common::MediaticData::MediaticData::single().stringsPool(m_language);
std::queue<LinguisticGraphVertex> toVisit;
std::set<LinguisticGraphVertex> visited;
toVisit.push(tokenList->firstVertex());
LinguisticGraphOutEdgeIt outItr,outItrEnd;
while (!toVisit.empty()) {
LinguisticGraphVertex v=toVisit.front();
toVisit.pop();
if (v == tokenList->lastVertex()) {
continue;
}
for (boost::tie(outItr,outItrEnd)=out_edges(v,*graph); outItr!=outItrEnd; outItr++)
{
LinguisticGraphVertex next=target(*outItr,*graph);
if (visited.find(next)==visited.end())
{
visited.insert(next);
toVisit.push(next);
}
}
const SpecificEntityAnnotation* annot=getSpecificEntityAnnotation(v,annotationData);
if (annot != 0) {
outputEntity(out,v,annot,tokenMap,offset);
}
}
}
else {
// take all annotations
AnnotationGraphVertexIt itv, itv_end;
boost::tie(itv, itv_end) = vertices(annotationData->getGraph());
for (; itv != itv_end; itv++)
{
// LDEBUG << "SpecificEntitiesXmlLogger on annotation vertex " << *itv;
if (annotationData->hasAnnotation(*itv,Common::Misc::utf8stdstring2limastring("SpecificEntity")))
{
// LDEBUG << " it has SpecificEntityAnnotation";
const SpecificEntityAnnotation* annot = 0;
try
{
annot = annotationData->annotation(*itv,Common::Misc::utf8stdstring2limastring("SpecificEntity"))
.pointerValue<SpecificEntityAnnotation>();
}
catch (const boost::bad_any_cast& )
{
SELOGINIT;
LERROR << "This annotation is not a SpecificEntity; SE not logged";
continue;
}
// recuperer l'id du vertex morph cree
LinguisticGraphVertex v;
if (!annotationData->hasIntAnnotation(*itv,Common::Misc::utf8stdstring2limastring(m_graph)))
{
// SELOGINIT;
// LDEBUG << *itv << " has no " << m_graph << " annotation. Skeeping it.";
continue;
}
v = annotationData->intAnnotation(*itv,Common::Misc::utf8stdstring2limastring(m_graph));
outputEntity(out,v,annot,tokenMap,offset);
}
}
}
// LDEBUG << " all vertices done";
if (m_compactFormat) {
out << "</entities>" << endl;
}
else {
out << "</specific_entities>" << endl;
}
delete dstream;
TimeUtils::logElapsedTime("SpecificEntitiesXmlLogger");
return SUCCESS_ID;
}