43namespace LinguisticProcessing
45namespace EntityTracking
71 auto metadata = std::dynamic_pointer_cast<LinguisticMetaData>(analysis.
getData(
"LinguisticMetaData"));
74 LERROR <<
"no LinguisticMetaData ! abort";
78 auto anagraph = std::dynamic_pointer_cast<AnalysisGraph>(analysis.
getData(
"AnalysisGraph"));
81 LERROR <<
"no graph 'AnaGraph' available !";
85 auto annotationData = std::dynamic_pointer_cast< AnnotationData >(analysis.
getData(
"AnnotationData"));
86 if (annotationData==0)
88 LERROR <<
"no annotation graph available !";
94 analysis.
setData(
"CoreferenceData",corefData);
101 std::queue<LinguisticGraphVertex> toVisit;
102 std::set<LinguisticGraphVertex> visited;
108 toVisit.push(firstVertex);
112 while (!toVisit.empty()) {
115 if (last || v == lastVertex) {
118 if (v == lastVertex) {
122 for (boost::tie(outItr,outItrEnd)=out_edges(v,*graph); outItr!=outItrEnd; outItr++)
125 if (visited.find(next)==visited.end())
127 visited.insert(next);
137 std::set< AnnotationGraphVertex > matches = annotationData->matches(
"AnalysisGraph",v,
"annot");
138 for (std::set< AnnotationGraphVertex >::const_iterator it = matches.begin();
139 it != matches.end(); it++)
167 vector<Token> vectTok;
175 if (vectTok.size() > 0)
177 corefData->push_back(vectTok);
This file is the main header file for the data related to annotation graphs.
#define ENTITYTRACKER_CLASSID
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.
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.
Manage initialization of InitializableObjects using configuration module and parameters.
void storeAnnot(const LinguisticAnalysisStructure::Token &token)
std::vector< LinguisticAnalysisStructure::Token > & getAnnotations()
std::vector< LinguisticAnalysisStructure::Token > searchCoreference(const LinguisticAnalysisStructure::Token &tok)
void storeAllToken(const LinguisticAnalysisStructure::Token &token)
LimaStatusCode process(AnalysisContent &analysis) const override
Process on data in analysisContent.
void init(Common::XMLConfigurationFiles::GroupConfigurationStructure &unitConfiguration, Manager *manager) override
initialize with parameters from configuration file.
holds surface data of a token
static void updateCurrentTime(const std::string &taskCategory=std::string(""))
store current time for new elapsed time computation
AnnotationGraph::vertex_descriptor AnnotationGraphVertex
LimaString utf8stdstring2limastring(const std::string &src)
SimpleFactory< MediaProcessUnit, EntityTracker > EntityTrackerFactory(ENTITYTRACKER_CLASSID)