LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData Class Reference

This class points to a graph, its dependency graph and the structure that holds the maping between the nodes of both graphs. More...

#include <linguisticProcessing/core/SyntacticAnalysis/SyntacticData.h>

Inheritance diagram for Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData:
Lima::AnalysisData

Public Types

typedef std::tuple< LinguisticGraphVertex, LinguisticGraphVertex, Common::MediaticData::SyntacticRelationId > Relation
 

Public Member Functions

 SyntacticData (LinguisticAnalysisStructure::AnalysisGraph *pit, std::shared_ptr< SyntagmDefStruct > matrices)
 This constructor uses the given graph to construct a dependency graph with the same number of vertices and it fills the mapping between them.
 
virtual ~SyntacticData ()
 
LinguisticGraph * graph ()
 
const LinguisticGraph * graph () const
 
DependencyGraph * dependencyGraph ()
 
const DependencyGraph * dependencyGraph () const
 
LinguisticAnalysisStructure::AnalysisGraph * iterator ()
 
const LinguisticAnalysisStructure::AnalysisGraph * iterator () const
 
std::shared_ptr< SyntagmDefStruct > matrices () const
 
void matrices (std::shared_ptr< SyntagmDefStruct > matrices)
 
std::vector< LinguisticAnalysisStructure::Token * > & ownedTokens ()
 
std::vector< LinguisticAnalysisStructure::MorphoSyntacticData * > & ownedMorphosyntacticData ()
 
DependencyGraphVertex depVertexForTokenVertex (const LinguisticGraphVertex &v) const
 
LinguisticGraphVertex tokenVertexForDepVertex (const DependencyGraphVertex &v) const
 
uint64_t depsBetween (const LinguisticGraphVertex &srcVertex, const LinguisticGraphVertex &tgtVertex)
 Computes the number of dependency relations in the graph between the given source and taget morphosyntactic vertices.
 
void setupDependencyGraph ()
 This method is used to setup the search of the dependency relations when the PoS tagging is done and thus the number of vertices will not change anymore in the morphosyntactic graph.
 
std::vector< LinguisticGraphVertex > findRelated (const LinguisticGraphVertex, const Common::MediaticData::SyntacticRelationId &relation)
 find vertices related to a given vertex by a given relation (related vertices can be either source or target of the relation)
 
std::vector< LinguisticGraphVertex > findRelated (const LinguisticGraphVertex, const std::set< Common::MediaticData::SyntacticRelationId > &relations)
 find vertices related to a given vertex a a relation that belongs to a given set of relations (related vertices can be either source or target of the relation)
 
void clearStoredRelations ()
 
Relation relation ()
 
bool relation (const LinguisticGraphVertex &v1, const LinguisticGraphVertex &v2, const Common::MediaticData::SyntacticRelationId relationType=0)
 
std::pair< LinguisticGraphVertex, DependencyGraphVertex > addVertex ()
 This method is used to setup the search of the dependency relations when the PoS tagging is done and thus the number of vertices will not change anymore in the morphosyntactic graph.
 
void addRelationNoChain (const Common::MediaticData::SyntacticRelationId &relType, const LinguisticGraphVertex &src, const LinguisticGraphVertex &dest)
 
void modifyRelationNoChain (const Common::MediaticData::SyntacticRelationId &relType, const LinguisticGraphVertex &src, const LinguisticGraphVertex &dest, const Common::MediaticData::SyntacticRelationId &newType)
 
bool storeRelationForSelectionalConstraint (const LinguisticGraphVertex &v1, const LinguisticGraphVertex &v2, const Common::MediaticData::SyntacticRelationId relationType=0)
 
Relation relationStoredForSelectionalConstraint ()
 
bool removeDependency (const LinguisticGraphVertex &v1, const LinguisticGraphVertex &v2, const Common::MediaticData::SyntacticRelationId relationType=0)
 
- Public Member Functions inherited from Lima::AnalysisData
virtual ~AnalysisData ()
 

Detailed Description

This class points to a graph, its dependency graph and the structure that holds the maping between the nodes of both graphs.

Note
if some vertices are added or removed from the graph, the changes should be reported in the dependency graph and the mapping

Definition at line 50 of file SyntacticData.h.

Member Typedef Documentation

◆ Relation

Constructor & Destructor Documentation

◆ SyntacticData()

Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::SyntacticData ( LinguisticAnalysisStructure::AnalysisGraph *  pit,
std::shared_ptr< SyntagmDefStruct >  matrices 
)

This constructor uses the given graph to construct a dependency graph with the same number of vertices and it fills the mapping between them.

Parameters
graphIN/OUT LinguisticGraph* the graph containing morphological data

Definition at line 29 of file SyntacticData.cpp.

◆ ~SyntacticData()

Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::~SyntacticData ( )
virtual

Definition at line 46 of file SyntacticData.cpp.

Member Function Documentation

◆ addRelationNoChain()

void Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::addRelationNoChain ( const Common::MediaticData::SyntacticRelationId &  relType,
const LinguisticGraphVertex &  src,
const LinguisticGraphVertex &  dest 
)

Definition at line 231 of file SyntacticData.cpp.

◆ addVertex()

std::pair< LinguisticGraphVertex, DependencyGraphVertex > Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::addVertex ( )

This method is used to setup the search of the dependency relations when the PoS tagging is done and thus the number of vertices will not change anymore in the morphosyntactic graph.

It creates a dependency graph with the same number of nodes than in the morphosyntactic graph and a mapping expressing the bijection between the nodes of both graphs.

Definition at line 106 of file SyntacticData.cpp.

◆ clearStoredRelations()

void Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::clearStoredRelations ( )
inline

Definition at line 127 of file SyntacticData.h.

◆ dependencyGraph() [1/2]

DependencyGraph * Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::dependencyGraph ( )
inline

Definition at line 68 of file SyntacticData.h.

◆ dependencyGraph() [2/2]

const DependencyGraph * Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::dependencyGraph ( ) const
inline

Definition at line 69 of file SyntacticData.h.

◆ depsBetween()

uint64_t Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::depsBetween ( const LinguisticGraphVertex &  srcVertex,
const LinguisticGraphVertex &  tgtVertex 
)

Computes the number of dependency relations in the graph between the given source and taget morphosyntactic vertices.

Computes the number of dependency relations in the graph between the given source and target morphosyntactic vertices.

Definition at line 144 of file SyntacticData.cpp.

◆ depVertexForTokenVertex()

DependencyGraphVertex Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::depVertexForTokenVertex ( const LinguisticGraphVertex &  v) const

Definition at line 119 of file SyntacticData.cpp.

◆ findRelated() [1/2]

std::vector< LinguisticGraphVertex > Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::findRelated ( const LinguisticGraphVertex  v,
const Common::MediaticData::SyntacticRelationId &  relation 
)

find vertices related to a given vertex by a given relation (related vertices can be either source or target of the relation)

Parameters
LinguisticGraphVertexthe given vertex
relationthe type of relation to look for
Returns
the list of related vertices

Definition at line 174 of file SyntacticData.cpp.

◆ findRelated() [2/2]

std::vector< LinguisticGraphVertex > Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::findRelated ( const LinguisticGraphVertex  v,
const std::set< Common::MediaticData::SyntacticRelationId > &  relations 
)

find vertices related to a given vertex a a relation that belongs to a given set of relations (related vertices can be either source or target of the relation)

Parameters
LinguisticGraphVertexthe given vertex
relationthe set of relations to look for

Definition at line 202 of file SyntacticData.cpp.

◆ graph() [1/2]

LinguisticGraph * Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::graph ( )
inline

Definition at line 65 of file SyntacticData.h.

◆ graph() [2/2]

const LinguisticGraph * Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::graph ( ) const
inline

Definition at line 66 of file SyntacticData.h.

◆ iterator() [1/2]

LinguisticAnalysisStructure::AnalysisGraph * Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::iterator ( )
inline

Definition at line 71 of file SyntacticData.h.

◆ iterator() [2/2]

const LinguisticAnalysisStructure::AnalysisGraph * Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::iterator ( ) const
inline

Definition at line 72 of file SyntacticData.h.

◆ matrices() [1/2]

std::shared_ptr< SyntagmDefStruct > Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::matrices ( ) const
inline

Definition at line 74 of file SyntacticData.h.

◆ matrices() [2/2]

void Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::matrices ( std::shared_ptr< SyntagmDefStruct >  matrices)
inline

Definition at line 75 of file SyntacticData.h.

◆ modifyRelationNoChain()

void Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::modifyRelationNoChain ( const Common::MediaticData::SyntacticRelationId &  relType,
const LinguisticGraphVertex &  src,
const LinguisticGraphVertex &  dest,
const Common::MediaticData::SyntacticRelationId &  newType 
)

Definition at line 265 of file SyntacticData.cpp.

◆ ownedMorphosyntacticData()

std::vector< LinguisticAnalysisStructure::MorphoSyntacticData * > & Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::ownedMorphosyntacticData ( )
inline

Definition at line 78 of file SyntacticData.h.

◆ ownedTokens()

std::vector< LinguisticAnalysisStructure::Token * > & Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::ownedTokens ( )
inline

Definition at line 77 of file SyntacticData.h.

◆ relation() [1/2]

Relation Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::relation ( )
inline

Definition at line 129 of file SyntacticData.h.

◆ relation() [2/2]

bool Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::relation ( const LinguisticGraphVertex &  v1,
const LinguisticGraphVertex &  v2,
const Common::MediaticData::SyntacticRelationId  relationType = 0 
)
inline

Definition at line 142 of file SyntacticData.h.

◆ relationStoredForSelectionalConstraint()

Relation Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::relationStoredForSelectionalConstraint ( )
inline

Definition at line 178 of file SyntacticData.h.

◆ removeDependency()

bool Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::removeDependency ( const LinguisticGraphVertex &  v1,
const LinguisticGraphVertex &  v2,
const Common::MediaticData::SyntacticRelationId  relationType = 0 
)

Definition at line 297 of file SyntacticData.cpp.

◆ setupDependencyGraph()

void Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::setupDependencyGraph ( )

This method is used to setup the search of the dependency relations when the PoS tagging is done and thus the number of vertices will not change anymore in the morphosyntactic graph.

It creates a dependency graph with the same number of nodes than in the morphosyntactic graph and a mapping expressing the bijection between the nodes of both graphs.

Definition at line 74 of file SyntacticData.cpp.

◆ storeRelationForSelectionalConstraint()

bool Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::storeRelationForSelectionalConstraint ( const LinguisticGraphVertex &  v1,
const LinguisticGraphVertex &  v2,
const Common::MediaticData::SyntacticRelationId  relationType = 0 
)
inline

Definition at line 170 of file SyntacticData.h.

◆ tokenVertexForDepVertex()

LinguisticGraphVertex Lima::LinguisticProcessing::SyntacticAnalysis::SyntacticData::tokenVertexForDepVertex ( const DependencyGraphVertex &  v) const

Definition at line 130 of file SyntacticData.cpp.


The documentation for this class was generated from the following files: