55namespace LinguisticProcessing
57namespace SyntacticAnalysis
85 auto syntacticData = std::dynamic_pointer_cast<SyntacticData>(analysis.
getData(
"SyntacticData"));
95 LDEBUG <<
"StoreForDisambiguation " << v1 <<
", " << v2 <<
", " <<
m_relation;
97 syntacticData->storeRelationForSelectionalConstraint(v1, v2,
m_relation);
112 LWARN <<
"no resource 'selectionalPreferences'";
115 m_preferences = std::dynamic_pointer_cast<SelectionalPreferences>(res);
118 catch (std::exception& e) {
121 LWARN <<
"Exception caught: " << e.what();
136 LDEBUG <<
"DisambiguateWith " << v1 <<
", " << v2;
138 auto syntacticData = std::dynamic_pointer_cast<SyntacticData>(analysis.
getData(
"SyntacticData"));
153 auto posgraph = std::dynamic_pointer_cast<AnalysisGraph>(analysis.
getData(
"PosGraph"));
157 LERROR <<
"no graph 'PosGraph' available !";
181 double preference = 0;
191 *(ov2Data->
allValues(macroAccessor).begin()),
194 *(ov1Data->
allValues(macroAccessor).begin()));
196 *(v2Data->
allValues(macroAccessor).begin()),
199 *(v1Data->
allValues(macroAccessor).begin()));
206 LDEBUG <<
"Old proba=" << oldProba <<
"; new proba=" << newProba;
208 preference = newProba - oldProba;
214 return syntacticData->removeDependency(std::get<0>(oldRelation),
215 std::get<1>(oldRelation),
216 std::get<2>(oldRelation));
This file is the main header file for the data related to annotation graphs.
A graph that stores the relations of syntactic dependency between the elements of a DependencyGraph.
boost::property_map< LinguisticGraph, vertex_data_t >::type VertexDataPropertyMap
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, LinguisticVertexProperties > LinguisticGraph
Property to identify the chains in the graph.
this file contains the definitions of several constraint functions for the disambiguation of dependen...
#define DisambiguateWithId
#define StoreForDisambiguationId
Data used for the syntactic analyzis of texts.
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
Provide function to read write and check a property.
An AnalysisData containing a LinguisticGraph with a language and an id.
const LinguisticGraphVertex & lastVertex(void) const
Returns the last vertex of the graph.
const LinguisticGraphVertex & firstVertex(void) const
Returns the first vertex of the graph.
Holds morphosyntactic informations.
std::set< StringsPoolIndex > allLemma() const
std::set< LinguisticCode > allValues(const Common::PropertyCode::PropertyAccessor &propertyAccessor) const
Abstract constraint function that takes a complement string that represents a relation name (entity t...
Common::MediaticData::SyntacticRelationId m_relation
bool operator()(const LinguisticAnalysisStructure::AnalysisGraph &graph, const LinguisticGraphVertex &v1, const LinguisticGraphVertex &v2, AnalysisContent &analysis) const override
binary constraint function : the constraint only applies on two vertices in the graph (the graph is a...
DisambiguateWith(MediaId language, const LimaString &complement=LimaString())
bool operator()(const LinguisticAnalysisStructure::AnalysisGraph &graph, const LinguisticGraphVertex &v1, const LinguisticGraphVertex &v2, AnalysisContent &analysis) const override
binary constraint function : the constraint only applies on two vertices in the graph (the graph is a...
StoreForDisambiguation(MediaId language, const LimaString &complement=LimaString())
std::tuple< LinguisticGraphVertex, LinguisticGraphVertex, Common::MediaticData::SyntacticRelationId > Relation
static const MediaticData & single()
const singleton accessor
static LinguisticResources & changeable()
singleton accessor
std::string limastring2utf8stdstring(const Lima::LimaString &phrase, uint32_t size0)
Convert a wide string to a string , in dest up to size bytes.
Automaton::ConstraintFunctionFactory< DisambiguateWith > DisambiguateWithFactory(DisambiguateWithId)
Automaton::ConstraintFunctionFactory< StoreForDisambiguation > StoreForDisambiguationFactory(StoreForDisambiguationId)