33namespace LinguisticProcessing
47 catch (
const boost::bad_any_cast& )
49 LERROR <<
"This annotation is not a CoreferentAnnotation ; nothing dumped";
62 const std::set< LinguisticCode >& inNpCategs,
67 if (data ==0 || data->empty()) {
return false; };
77 std::set<DependencyGraphVertex>* alreadyProcessed)
const
80 alreadyProcessed->insert(headNode);
83 boost::tie(it, it_end) = boost::out_edges(headNode, *(sd->
dependencyGraph()));
88 for (; it != it_end; it++)
94 if (relationName==
"MOD_N")
98 if (alreadyProcessed->find(headNode)==alreadyProcessed->end())
110 const std::set< LinguisticCode >& categs,
115 if (data ==0 || data->empty()) {
return false; };
117 return (categs.find(
categ)!=categs.end());
132 if (data ==0 || data->empty()) {
return false; };
133 return (data->
firstValue(*macroAccessor) == L_PRON);
139 const std::string& definiteRel,
140 const std::set< LinguisticCode >& definiteCategs,
142 MediaId language)
const
148 boost::tie(it, it_end) = boost::in_edges(dv, *(sd->
dependencyGraph()));
149 for (; it != it_end; it++)
154 if (relationName == definiteRel)
157 if (data ==0 || data->empty()) {
return false; };
158 return (definiteCategs.find(data->
firstValue(*microAccessor)) != definiteCategs.end());
168 const std::string& pleonRel,
169 MediaId language)
const
175 boost::tie(it, it_end) = boost::out_edges(dv, *(sd->
dependencyGraph()));
176 for (; it != it_end; it++)
181 if (relationName == pleonRel)
195 const std::map<std::string,LinguisticCode>& tagLocalDef,
196 const std::map<std::string, std::deque<std::string> >& relLocalDef,
197 const std::set< LinguisticCode >& definiteCategs,
198 const std::set< LinguisticCode >& reflexiveReciprocalCategs,
199 const std::set< LinguisticCode >& undefPronounsCategs,
200 const std::set< LinguisticCode >& possPronounsCategs,
203 MediaId language)
const
206 LinguisticCode L_PRON = (*tagLocalDef.find(
"PronMacroCategory")).second;
207 std::string pleonRel = *(*relLocalDef.find(
"PleonasticRelation")).second.begin();
208 std::string defRel = *(*relLocalDef.find(
"DefiniteRelation")).second.begin();
232 return isPleonastic(sd,pleonRel,language)?
"pleon":
"other";
236 return isDefinite(sd,defRel,definiteCategs,microAccessor,language)?
"def":
"undef";
271 std::set<DependencyGraphVertex>* alreadyProcessed)
const
279 if (alreadyProcessed->find(head)==alreadyProcessed->end())
291 for (; it != it_end; it++)
308 const std::map<std::string,LinguisticCode>& tagLocalDef,
312 set<LinguisticGraphVertex>* alreadyProcessed)
const
317 if (it == it_end)
return false;
321 for (; it != it_end; it++)
323 qv = target(*it,*anagraph->
getGraph());
332 else if (alreadyProcessed->find(qv)==alreadyProcessed->end())
334 alreadyProcessed->insert(qv);
335 return CoreferentAnnotation(0,qv).isInSubordinate(sd, macroAccessor,tagLocalDef, language, anagraph, ac, alreadyProcessed);
339 if (qv!=0 && alreadyProcessed->find(qv)==alreadyProcessed->end())
341 alreadyProcessed->insert(qv);
342 return CoreferentAnnotation(0,qv).isInSubordinate(sd, macroAccessor,tagLocalDef, language, anagraph, ac, alreadyProcessed);
356 const std::deque<std::string>& macroDependencyRelation,
357 MediaId language)
const
363 if (it == it_end)
return false;
367 for (; it != it_end; it++)
372 std::deque<std::string>::const_iterator it2;
373 for (it2 = macroDependencyRelation.begin( );
374 it2 != macroDependencyRelation.end( );
378 if (relationName == *it2)
382 else if (relationName ==
"COORD2")
386 boost::tie(it3, it3_end) = boost::out_edges(target(*it,*sd-> dependencyGraph()), *(sd->
dependencyGraph()));
387 if (it3 == it3_end)
return false;
389 for (; it3 != it3_end; it3++)
405 const std::map<std::string,LinguisticCode>& tagLocalDef,
411 if (data ==0 || data->empty()) {
return false; };
412 LinguisticCode L_VERB = (*tagLocalDef.find(
"VerbMacroCategory")).second;
428 if (data ==0 || data->empty()) {
return false; };
429 if(data->
firstValue(*microAccessor)==conjCoord)
450 if (it==it_end)
return false;
454 boost::tie(it2, it2_end) = boost::in_edges(source(*it, g),g);
455 if (it2==it2_end)
return false;
457 if (data1 ==0 || data1->empty()) {
return false; };
458 for (MorphoSyntacticData::iterator msdataIt = data1->begin(); msdataIt!=data1->end(); msdataIt++)
471 if (it==it_end)
return false;
473 if (data1 ==0 || data1->empty()) {
return false; };
474 for (MorphoSyntacticData::iterator msdataIt = data1->begin(); msdataIt!=data1->end(); msdataIt++)
502 if (data1 ==0 || data1->empty()) {
return false; };
503 bool isPlural =
false;
504 for (MorphoSyntacticData::iterator it = data1->begin(); it!=data1->end(); it++)
512 bool isMascPlural =
false;
513 for (MorphoSyntacticData::iterator it = data1->begin(); it!=data1->end(); it++)
523 if (data2 ==0 || data2->empty()) {
return false; };
540 bool PersonAgreement =
547 return (genderAgreement && NumberAgreement && PersonAgreement);
559 const std::map<std::string,LinguisticCode>& tagLocalDef,
561 set<LinguisticGraphVertex>* alreadyProcessed)
const
576 for (; it != it_end; it++)
608 ( anaHead.
isVerb(macroAccessor,tagLocalDef, anagraph)
622 alreadyProcessed->find(anaHead.
m_morphVertex)==alreadyProcessed->end())
624 return anaHead.
isInTheArgumentDomainOf(
CoreferentAnnotation(0,ca.
npHeadVertex(sd,language,
new set<DependencyGraphVertex>())), sd, language, anagraph, ac, macroAccessor, microAccessor, tagLocalDef, conjCoord, alreadyProcessed)
644 const std::map<std::string,LinguisticCode>& tagLocalDef,
646 set<LinguisticGraphVertex>* alreadyProcessed)
const
663 for (; it != it_end; it++)
685 alreadyProcessed->find(anaHead.
m_morphVertex)==alreadyProcessed->end())
687 return anaHead.
isInTheArgumentDomainOf(
CoreferentAnnotation(0,ca.
npHeadVertex(sd,language,
new set<DependencyGraphVertex>())), sd, language, anagraph, ac, macroAccessor, microAccessor, tagLocalDef, conjCoord, alreadyProcessed)
704 const std::map<std::string,LinguisticCode>& tagLocalDef,
705 const std::map<std::string, std::deque<std::string> >& relLocalDef,
706 MediaId language)
const
713 boost::tie(it, it_end) = boost::out_edges(headNode, *(sd->
dependencyGraph()));
719 for (; it != it_end; it++)
722 if (
isInThePrepAdjunctNP(headNode, sd, graph, macroAccessor, tagLocalDef, relLocalDef,language))
738 const std::map<std::string,LinguisticCode>& tagLocalDef,
739 const std::map<std::string, std::deque<std::string> >& relLocalDef,
740 MediaId language)
const
745 if (data ==0 || data->empty()) {
return false; };
746 LinguisticCode L_VERB = (*tagLocalDef.find(
"VerbMacroCategory")).second;
759 if (it2==it2_end)
return false;
784 if (ca.
isPronoun(g, macroAccessor, L_PRON))
797 for (; it != it_end; it++)
817 const std::map<std::string,LinguisticCode>& ,
818 const std::map<std::string,std::deque<std::string> >& ,
843return ca.
npHeadVertex(sd, language,
new set<DependencyGraphVertex>())==
npHeadVertex(sd, language,
new set<DependencyGraphVertex>());
866 const std::map<std::string,std::deque<std::string> >& relLocalDef,
873 std::deque<std::string> detRels = (*relLocalDef.find(
"NPDeterminerRelation")).second;
874 for (std::deque<std::string>::iterator itDet= detRels.begin(); itDet != detRels.end(); itDet++)
878 for (;itN!=itN_end; itN++)
894 const std::map<std::string,std::deque<std::string> >& relLocalDef,
906 return (this->
isDeterminer(qv,sd, relLocalDef, language, anagraph, ac) && ca.
isContainedIn(*qv, language, anagraph, ac));
917 const std::map<std::string,LinguisticCode >& tagLocalDef,
918 const std::map<std::string,std::deque<std::string> >& relLocalDef,
922 const std::set< LinguisticCode >& inNpCategs,
926 std::deque<Vertices>* npCandidates)
const
936 std::deque<std::string> detRels = (*relLocalDef.find(
"NPDeterminerRelation")).second;
937 std::deque<std::string> adjunctRels = (*relLocalDef.find(
"AdjunctRelation")).second;
938 LinguisticCode L_VERB = (*tagLocalDef.find(
"VerbMacroCategory")).second;
944 for (;itN!=itN_end; itN++)
948 if (data ==0 || data->empty()) {
continue; };
950 if (data->
firstValue(*macroAccessor) == L_VERB)
957 for (std::deque<Vertices>::iterator itm = npCandidates->begin();
958 itm != npCandidates->end( );
961 for (Vertices::iterator candidateItr = (*itm).begin( );
962 candidateItr != (*itm).end( );
965 if ((*candidateItr)->isIncludedInNounPhrase(anagraph->
getGraph(), language, anagraph, ac, inNpCategs, microAccessor) )
969 if ((*candidateItr)->isInTheArgumentDomainOf(*
this,sd, language, anagraph, ac, macroAccessor, microAccessor, tagLocalDef, conjCoord,
new set<LinguisticGraphVertex>()))
971 bool hasDeterminer =
false;
974 for (std::deque<std::string>::iterator itDet= detRels.begin(); itDet != detRels.end(); itDet++)
978 hasDeterminer =
true;
1030 const std::map<std::string,std::deque<std::string> >& relLocalDef,
1031 const std::map<std::string, int>& slotValues,
1032 MediaId language)
const
1035 std::map<std::string,std::deque<std::string> >::const_iterator rel = relLocalDef.find(
"SubjectRelation");
1036 if (rel == relLocalDef.end())
1038 LERROR <<
"\"SubjectRelation\" not defined in s2-lp-xxx.xml";
1042 return (*slotValues.find(
"SubjectRelation")).second;
1045 rel = relLocalDef.find(
"AgentRelation");
1046 if (rel == relLocalDef.end())
1048 LERROR <<
"\"AgentRelation\" not defined in s2-lp-xxx.xml";
1052 return (*slotValues.find(
"AgentRelation")).second;
1054 rel = relLocalDef.find(
"CODRelation");
1055 if (rel == relLocalDef.end())
1057 LERROR <<
"\"CODRelation\" not defined in s2-lp-xxx.xml";
1060 return (*slotValues.find(
"CODRelation")).second;
1062 rel = relLocalDef.find(
"COIRelation");
1063 if (rel == relLocalDef.end())
1065 LERROR <<
"\"COIRelation\" not defined in s2-lp-xxx.xml";
1068 return (*slotValues.find(
"COIRelation")).second;
1070 rel = relLocalDef.find(
"AdjunctRelation");
1071 if (rel == relLocalDef.end())
1073 LERROR <<
"\"AdjunctRelation\" not defined in s2-lp-xxx.xml";
1076 return (*slotValues.find(
"AdjunctRelation")).second;
1089 const std::map<std::string,LinguisticCode>& tagLocalDef,
1090 const std::map<std::string,std::deque<std::string> >& relLocalDef,
1096 const std::map<std::string, int>& slotValues,
1102 LinguisticCode NC = (*tagLocalDef.find(
"NomCommunMacroCategory")).second;
1103 LinguisticCode NP = (*tagLocalDef.find(
"NomPropreMacroCategory")).second;
1106 if (ca.
isDeterminer(qv,sd, relLocalDef, language, anagraph, ac))
1109 if (data ==0 || data->empty()) {
return false; };
1115 if (caQ.
isInTheArgumentDomainOf(ca,sd, language, anagraph, ac, macroAccessor, microAccessor, tagLocalDef, conjCoord,
new set<LinguisticGraphVertex>()))
1118 if (ca.
getSlotValue(sd, relLocalDef, slotValues,language) > caQ.
getSlotValue(sd, relLocalDef, slotValues,language))
1143 const std::map<std::string,LinguisticCode>& tagLocalDef,
1144 const std::map<std::string, std::deque<std::string> >& relLocalDef,
1145 const std::set< LinguisticCode >& definiteCategs,
1146 const std::set< LinguisticCode >& reflexiveReciprocalCategs,
1147 const std::set< LinguisticCode >& undefPronouns,
1148 const std::set< LinguisticCode >& possPronouns,
1149 const bool& resolveDefinites,
1150 const bool& resolveN3PPronouns,
1156 std::string type =
referentType(sd,graph,macroAccessor,microAccessor, tagLocalDef, relLocalDef ,definiteCategs, reflexiveReciprocalCategs, undefPronouns,possPronouns, personAccessor, anagraph, language);
1160 || (type ==
"reflPron")
1161 || (resolveDefinites && type ==
"def")
1162 || (resolveN3PPronouns && type ==
"N3Ppron") )
1167 if (type!=
"pleon" && (type!=
"N3Ppron" || resolveN3PPronouns) && type!=
"reflPron" && type!=
"on" && type!=
"undefPron")
1175 const std::map<std::string,float>& weights,
1180 const std::map< std::string,LinguisticCode>& tagLocalDef,
1181 const std::map< std::string,std::deque<std::string> >& relLocalDef,
1188 if (weights.find(
"SentenceRecency")!=weights.end())
1190 res += (*weights.find(
"SentenceRecency")).second;
1192 if (weights.find(
"SubjEmph")!=weights.end() &&
isFunctionMasterOf(sd,(*relLocalDef.find(
"SubjectRelation")).second,language))
1194 res += weights.find(
"SubjEmph")->second;
1196 if (weights.find(
"ExistEmph")!=weights.end() &&
isFunctionMasterOf(sd,(*relLocalDef.find(
"AttributeRelation")).second,language))
1198 res += weights.find(
"ExistEmph")->second;
1200 if (weights.find(
"CodEmph")!=weights.end() &&
isFunctionMasterOf(sd,(*relLocalDef.find(
"CODRelation")).second,language))
1202 res += weights.find(
"CodEmph")->second;
1204 if (weights.find(
"CoiCoblEmph")!=weights.end() &&
isFunctionMasterOf(sd,(*relLocalDef.find(
"COIRelation")).second,language))
1206 res += weights.find(
"CoiCoblEmph")->second;
1210 res += weights.find(
"HeadEmph")->second;
1212 if (weights.find(
"NonAdvEmph")!=weights.end() && !
CoreferentAnnotation(0,
npHeadVertex(sd,language,
new set<DependencyGraphVertex>())).isFunctionMasterOf(sd,(*relLocalDef.find(
"AdjunctRelation")).second,language))
1214 res += weights.find(
"NonAdvEmph")->second;
1216 if (weights.find(
"IsInSubordinate")!=weights.end() && weights.find(
"IsInSubordinate")->second!=0 &&
isInSubordinate(sd,macroAccessor,tagLocalDef,language,anagraph,ac,
new set<LinguisticGraphVertex>()))
1218 res += weights.find(
"IsInSubordinate")->second;
1222 if (weights.find(
"NoAntecedencyPotential")!=weights.end() && weights.find(
"NoAntecedencyPotential")->second!=0 && token != 0 &&
limastring2utf8stdstring(token->
stringForm()) ==
"y")
1224 res += weights.find(
"NoAntecedencyPotential")->second;
1226 if (weights.find(
"Appos")!=weights.end() && weights.find(
"Appos")->second!=0 &&
isInAppos(sd,anagraph,ac,language,
new std::set<DependencyGraphVertex>()))
1228 res += weights.find(
"Appos")->second;
1230 if (weights.find(
"BeginWithColon")!=weights.end() && weights.find(
"BeginWithColon")->second!=0 &&
beginWithColon(anagraph,beginSentence))
1232 res += weights.find(
"BeginWithColon")->second;
1234 if (weights.find(
"EndWithColon")!=weights.end() && weights.find(
"EndWithColon")->second!=0 &&
endWithColon(anagraph,endSentence))
1236 res += weights.find(
"EndWithColon")->second;
1238 if (weights.find(
"AntecedencyPotential")!=weights.end() && weights.find(
"AntecedencyPotential")->second!=0 &&
isInQuantA(sd,anagraph))
1240 res += weights.find(
"AntecedencyPotential")->second;
1253 if (matches.empty())
1256 LERROR <<
"CoreferentAnnotation::writeAnnotation No annotation graph vertex matches PoS graph vertex " <<
m_morphVertex <<
". This should not happen.";
1270 std::set< AnnotationGraphVertex > antecedentMatches = ad->
matches(
"PosGraph",antecedent.
m_morphVertex,
"annot");
1271 if (antecedentMatches.empty())
1274 LERROR <<
"CoreferentAnnotation::writeAnnotation No annotation graph vertex matches PoS graph antecedent vertex " << antecedent.
m_morphVertex <<
". This should not happen.";
1291 if (
av!=antecedentAv)
1308 bool hasAntecedent =
false;
1310 if (matches.empty())
1313 LERROR <<
"CoreferentAnnotation::dump No annotation graph vertex matches PoS graph vertex " <<
m_morphVertex <<
". This should not happen.";
1318 boost::tie(it, it_end) = boost::out_edges(
av, ad->
getGraph());
1321 for (; it != it_end; it++)
1327 hasAntecedent =
true;
1330 catch (
const boost::bad_any_cast& )
1338 os <<
"#" << antecedent.
id();
1345 LDEBUG <<
"CoreferentAnnotation::outputXml";
1347 bool hasAntecedent =
false;
1349 if (matches.empty())
1352 LERROR <<
"CoreferentAnnotation::outputXml No annotation graph vertex matches PoS graph vertex " <<
m_morphVertex <<
". This should not happen.";
1357 boost::tie(it, it_end) = boost::out_edges(
av, ad->
getGraph());
1360 for (; it != it_end; it++)
1366 hasAntecedent =
true;
1368 catch (
const boost::bad_any_cast& )
1376 xmlStream <<
"<COREF ID=\"" <<
m_id <<
"\" TYPE=\"IDENT\" REF=\"" << antecedent.
id() <<
"\"";
1377 xmlStream <<
" SALIENCE=\"" <<
salience() <<
"\"";
1381 xmlStream <<
"<COREF ID=\"" <<
m_id<<
"\"";
1383 xmlStream <<
" CATEG=\"" <<
categ() <<
"\">";
1388 xmlStream << token->
stringForm().toStdString();
1394 xmlStream <<
"</COREF>";
This file is the main header file for the data related to annotation graphs.
DependencyGraph::in_edge_iterator DependencyGraphInEdgeIt
DependencyGraph::out_edge_iterator DependencyGraphOutEdgeIt
DependencyGraph::vertex_descriptor DependencyGraphVertex
boost::property_map< DependencyGraph, edge_deprel_type_t >::const_type CEdgeDepRelTypePropertyMap
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, DepVertexProperties, DepEdgeProperties > DependencyGraph
The dependency graph class.
#define PROCESSORSLOGINIT
boost::property_map< LinguisticGraph, vertex_data_t >::const_type CVertexDataPropertyMap
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, LinguisticVertexProperties > LinguisticGraph
Property to identify the chains in the graph.
#define COREFSOLVERLOGINIT
Data used for the syntactic analyzis of texts.
Holds all data that pass through the ProcessUnits Analysis data are shared pointers,...
Holds an annotation graph and gives an API to manipulate it.
std::set< AnnotationGraphVertex > matches(const std::string &first, AnnotationGraphVertex firstVx, const std::string &second) const
Gets the set of vertices matched in the second graph by the given vertex of the first graph.
const GenericAnnotation & annotation(AnnotationGraphVertex v1, AnnotationGraphVertex v2, const LimaString &annot) const
AnnotationGraphEdge createAnnotationEdge(AnnotationGraphVertex s, AnnotationGraphVertex t)
Creates a new annotation edge in the graph.
This class allows to convert any object into an annotation by inheritance.
Provide function to read write and check a property.
LinguisticCode readValue(const LinguisticCode &code) const
read a property in a coded int.
static LinguisticCode fromUInt(uint64_t v)
bool aba4(const CoreferentAnnotation &ca, const SyntacticAnalysis::SyntacticData *sd, const std::map< std::string, LinguisticCode > &tagLocalDef, const std::map< std::string, std::deque< std::string > > &relLocalDef, const Common::PropertyCode::PropertyAccessor *macroAccessor, const Common::PropertyCode::PropertyAccessor *microAccessor, MediaId language, const std::set< LinguisticCode > &inNpCategs, LinguisticAnalysisStructure::AnalysisGraph *anagraph, AnalysisContent &ac, const LinguisticCode &conjCoord, std::deque< Vertices > *npCandidates) const
bool endWithColon(const LinguisticAnalysisStructure::AnalysisGraph *anagraph, LinguisticGraphVertex &endSentence) const
int classify(LinguisticGraph *graph, SyntacticAnalysis::SyntacticData *sd, const Common::PropertyCode::PropertyAccessor *macroAccessor, const Common::PropertyCode::PropertyAccessor *microAccessor, const std::map< std::string, LinguisticCode > &tagLocalDef, const std::map< std::string, std::deque< std::string > > &relLocalDef, const std::set< LinguisticCode > &definiteCategs, const std::set< LinguisticCode > &reflexiveReciprocalCategs, const std::set< LinguisticCode > &undefPronouns, const std::set< LinguisticCode > &possPronouns, const bool &resolveDefinites, const bool &resolveN3PPronouns, const Common::PropertyCode::PropertyAccessor *personAccessor, const LinguisticAnalysisStructure::AnalysisGraph *anagraph, MediaId language)
main functions of the global algorithm (called by Corefsolver)
std::string referentType(const SyntacticAnalysis::SyntacticData *sd, const LinguisticGraph *g, const Common::PropertyCode::PropertyAccessor *macroAccessor, const Common::PropertyCode::PropertyAccessor *microAccessor, const std::map< std::string, LinguisticCode > &tagLocalDef, const std::map< std::string, std::deque< std::string > > &relLocalDef, const std::set< LinguisticCode > &definiteCategs, const std::set< LinguisticCode > &reflexiveReciprocalCategs, const std::set< LinguisticCode > &undefPronounsCategs, const std::set< LinguisticCode > &possPronounsCategs, const Common::PropertyCode::PropertyAccessor *personAccessor, const LinguisticAnalysisStructure::AnalysisGraph *anagraph, MediaId language) const
bool isTaggedAsOneOfThese(const LinguisticGraph *g, const std::set< LinguisticCode > &categs, const Common::PropertyCode::PropertyAccessor *microAccessor) const
bool isContainedIn(const DependencyGraphVertex &dv, MediaId language, const LinguisticAnalysisStructure::AnalysisGraph *anagraph, AnalysisContent &ac) const
bool isGovernedByMasculineCoordinate(const SyntacticAnalysis::SyntacticData *sd, const Common::PropertyCode::PropertyAccessor *genderAccessor, MediaId language, const LinguisticAnalysisStructure::AnalysisGraph *anagraph, AnalysisContent &ac) const
bool isInTheNpDomainOf(const CoreferentAnnotation &ca, const SyntacticAnalysis::SyntacticData *sd, const Common::PropertyCode::PropertyAccessor *microAccessor, const std::map< std::string, LinguisticCode > &tagLocalDef, const std::map< std::string, std::deque< std::string > > &relLocalDef, MediaId language, const LinguisticAnalysisStructure::AnalysisGraph *anagraph, AnalysisContent &ac) const
bool isDeterminer(DependencyGraphVertex *qv, const SyntacticAnalysis::SyntacticData *sd, const std::map< std::string, std::deque< std::string > > &relLocalDef, MediaId language, const LinguisticAnalysisStructure::AnalysisGraph *anagraph, AnalysisContent &ac) const
bool sf4(const CoreferentAnnotation &ca, const SyntacticAnalysis::SyntacticData *sd, const Common::PropertyCode::PropertyAccessor *macroAccessor, const LinguisticCode &L_PRON, MediaId language, const LinguisticAnalysisStructure::AnalysisGraph *anagraph, AnalysisContent &ac) const
bool isInTheAdjunctDomainOf(const CoreferentAnnotation &ca, const SyntacticAnalysis::SyntacticData *sd, const LinguisticGraph *graph, const Common::PropertyCode::PropertyAccessor *microAccessor, const std::map< std::string, LinguisticCode > &tagLocalDef, const std::map< std::string, std::deque< std::string > > &relLocalDef, MediaId language) const
void dump(std::ostream &os, const Lima::Common::AnnotationGraphs::AnnotationData *ad) const
float salienceWeighting(const std::map< std::string, float > &weights, const SyntacticAnalysis::SyntacticData *sd, const Common::PropertyCode::PropertyAccessor *macroAccessor, const LinguisticAnalysisStructure::AnalysisGraph *anagraph, MediaId language, const std::map< std::string, LinguisticCode > &tagLocalDef, const std::map< std::string, std::deque< std::string > > &relLocalDef, AnalysisContent &ac, LinguisticGraphVertex &beginSentence, LinguisticGraphVertex &endSentence) const
bool isInTheArgumentDomainOf(const CoreferentAnnotation &ca, const SyntacticAnalysis::SyntacticData *sd, MediaId language, const LinguisticAnalysisStructure::AnalysisGraph *anagraph, AnalysisContent &ac, const Common::PropertyCode::PropertyAccessor *macroAccessor, const Common::PropertyCode::PropertyAccessor *microAccessor, const std::map< std::string, LinguisticCode > &tagLocalDef, const LinguisticCode &conjCoord, std::set< LinguisticGraphVertex > *alreadyProcessed) const
virtual void outputXml(std::ostream &xmlStream, const LinguisticGraph &g, const Common::AnnotationGraphs::AnnotationData *ad) const
bool isInTheArgumentDomainOf2(const CoreferentAnnotation &ca, const SyntacticAnalysis::SyntacticData *sd, MediaId language, const LinguisticAnalysisStructure::AnalysisGraph *anagraph, AnalysisContent &ac, const Common::PropertyCode::PropertyAccessor *macroAccessor, const Common::PropertyCode::PropertyAccessor *microAccessor, const std::map< std::string, LinguisticCode > &tagLocalDef, const LinguisticCode &conjCoord, std::set< LinguisticGraphVertex > *alreadyProcessed) const
bool beginWithColon(const LinguisticAnalysisStructure::AnalysisGraph *anagraph, LinguisticGraphVertex &beginSentence) const
test functions for the salience weighting
bool isDefinite(const SyntacticAnalysis::SyntacticData *sd, const std::string &definiteRel, const std::set< LinguisticCode > &definiteCategs, const Common::PropertyCode::PropertyAccessor *microAccessor, MediaId language) const
test functions for the initial classification
AnnotationGraphVertex av()
AnnotationGraphVertex writeAnnotation(Common::AnnotationGraphs::AnnotationData *ad, CoreferentAnnotation &antecedent) const
bool isPronoun(const LinguisticGraph *g, const Common::PropertyCode::PropertyAccessor *macroAccessor, const LinguisticCode &L_PRON) const
test functions for the initial classification
bool isPleonastic(const SyntacticAnalysis::SyntacticData *sd, const std::string &m_pleonRel, MediaId language) const
bool isInThePrepAdjunctNP(const DependencyGraphVertex &qv, const SyntacticAnalysis::SyntacticData *sd, const LinguisticGraph *graph, const Common::PropertyCode::PropertyAccessor *microAccessor, const std::map< std::string, LinguisticCode > &tagLocalDef, const std::map< std::string, std::deque< std::string > > &relLocalDef, MediaId language) const
bool isInSubordinate(const SyntacticAnalysis::SyntacticData *sd, const Common::PropertyCode::PropertyAccessor *macroAccessor, const std::map< std::string, LinguisticCode > &tagLocalDef, MediaId language, const LinguisticAnalysisStructure::AnalysisGraph *anagraph, AnalysisContent &ac, std::set< LinguisticGraphVertex > *alreadyProcessed) const
bool sf6(const CoreferentAnnotation &ca, const SyntacticAnalysis::SyntacticData *sd, const std::map< std::string, std::deque< std::string > > &relLocalDef, MediaId language, const LinguisticAnalysisStructure::AnalysisGraph *anagraph, AnalysisContent &ac) const
int getSlotValue(const SyntacticAnalysis::SyntacticData *sd, const std::map< std::string, std::deque< std::string > > &relLocalDef, const std::map< std::string, int > &slotValues, MediaId language) const
LinguisticGraphVertex npHeadVertex(const SyntacticAnalysis::SyntacticData *sd, MediaId language, std::set< DependencyGraphVertex > *alreadyProcessed) const
bool aba5(const CoreferentAnnotation &ca, const SyntacticAnalysis::SyntacticData *sd, const std::map< std::string, LinguisticCode > &tagLocalDef, const std::map< std::string, std::deque< std::string > > &relLocalDef, const Common::PropertyCode::PropertyAccessor *macroAccessor, const Common::PropertyCode::PropertyAccessor *microAccessor, MediaId language, LinguisticAnalysisStructure::AnalysisGraph *anagraph, AnalysisContent &ac, const std::map< std::string, int > &slotValues, const LinguisticCode &conjCoord) const
bool isConjCoord(const Common::PropertyCode::PropertyAccessor *microAccessor, const LinguisticAnalysisStructure::AnalysisGraph *anagraph, const LinguisticCode &conjCoord) const
bool isAgreementCompatibleWith(const CoreferentAnnotation &ca, const SyntacticAnalysis::SyntacticData *sd, const Common::PropertyCode::PropertyAccessor *genderAccessor, const Common::PropertyCode::PropertyAccessor *personAccessor, const Common::PropertyCode::PropertyAccessor *numberAccessor, MediaId language, const LinguisticAnalysisStructure::AnalysisGraph *anagraph, AnalysisContent &ac) const
bool isFunctionMasterOf(const SyntacticAnalysis::SyntacticData *sd, const std::deque< std::string > ¯oDependencyRelation, MediaId language) const
returns true if *this governs a macroDependencyRelation (cf.
bool isVerb(const Common::PropertyCode::PropertyAccessor *macroAccessor, const std::map< std::string, LinguisticCode > &tagLocalDef, const LinguisticAnalysisStructure::AnalysisGraph *anagraph) const
test functions for the syntactic filter and the reflexive binding algorithm
bool isIncludedInNounPhrase(const LinguisticGraph *g, MediaId language, const LinguisticAnalysisStructure::AnalysisGraph *anagraph, AnalysisContent &ac, const std::set< LinguisticCode > &inNpCategs, const Common::PropertyCode::PropertyAccessor *microAccessor) const
general test functions
bool isInAppos(const SyntacticAnalysis::SyntacticData *sd, const LinguisticAnalysisStructure::AnalysisGraph *anagraph, AnalysisContent &ac, MediaId language, std::set< DependencyGraphVertex > *alreadyProcessed) const
LinguisticGraphVertex m_morphVertex
bool isInQuantA(const SyntacticAnalysis::SyntacticData *sd, const LinguisticAnalysisStructure::AnalysisGraph *anagraph) const
bool isN3PPronoun(const Common::PropertyCode::PropertyAccessor *personAccessor, const LinguisticAnalysisStructure::AnalysisGraph *anagraph) const
DumpCoreferent(const Lima::Common::AnnotationGraphs::AnnotationData *ad)
virtual int dump(std::ostream &os, Common::AnnotationGraphs::GenericAnnotation &ga) const override
An AnalysisData containing a LinguisticGraph with a language and an id.
const LinguisticGraph * getGraph(void) const
Returns the underlying graph structure.
Holds morphosyntactic informations.
LinguisticCode firstValue(const Common::PropertyCode::PropertyAccessor &propertyAccessor) const
Return the first non empty value for the given accessor.
bool isAlphaPossessive() const
holds surface data of a token
const TStatus & status() const
const LimaString & stringForm() const
This constraint tests if its argument is governed by a relation of the given type.
This constraint tests if its argument is the governor of a relation of the given type.
This constraint tests if the second argument is not governed by the first one with a relation of the ...
This class points to a graph, its dependency graph and the structure that holds the maping between th...
LinguisticGraphVertex tokenVertexForDepVertex(const DependencyGraphVertex &v) const
DependencyGraphVertex depVertexForTokenVertex(const LinguisticGraphVertex &v) const
DependencyGraph * dependencyGraph()
static const MediaticData & single()
const singleton accessor
AnnotationGraph & getGraph()
AnnotationGraph::vertex_descriptor AnnotationGraphVertex
AnnotationGraph::out_edge_iterator AnnotationGraphOutEdgeIt
bool hasAnnotation(AnnotationGraphVertex v, const LimaString &annot) const
void annotate(AnnotationGraphVertex v, const LimaString &annot, uint64_t value)
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)