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

#include <linguisticProcessing/core/ApplyRecognizer/applyRecognizerActions.h>

Inheritance diagram for Lima::LinguisticProcessing::ApplyRecognizer::CreateAlternative:
Lima::LinguisticProcessing::Automaton::ConstraintFunction Lima::LinguisticProcessing::MorphologicAnalysis::CreateIdiomaticAlternative

Public Member Functions

 CreateAlternative (MediaId language, const LimaString &complement=LimaString())
 
virtual ~CreateAlternative ()
 
virtual bool operator() (Automaton::RecognizerMatch &result, AnalysisContent &analysis) const override
 zero-ary constraint function : applies the function without a vertex indication (used for actions, not constraints -> applied only at end, when a match is found: uses the result of the match
 
bool actionNeedsRecognizedExpression () override
 
- Public Member Functions inherited from Lima::LinguisticProcessing::Automaton::ConstraintFunction
virtual ~ConstraintFunction ()
 
virtual bool operator() (const LinguisticAnalysisStructure::AnalysisGraph &, const LinguisticGraphVertex &, const LinguisticGraphVertex &, AnalysisContent &) const
 binary constraint function : the constraint only applies on two vertices in the graph (the graph is also given as a parameter).
 
virtual bool operator() (const LinguisticAnalysisStructure::AnalysisGraph &, const LinguisticGraphVertex &, AnalysisContent &) const
 unary constraint function : the constraint only applies on one vertices in the graph (the graph is also given as a parameter).
 
virtual bool operator() (AnalysisContent &) const
 zero-ary constraint function : applies the function without a vertex indication (used for actions, not constraints -> applied only at end, when a match is found)
 
const LimaString & getComplementString ()
 
unsigned char getLanguage ()
 

Protected Member Functions

std::pair< LinguisticAnalysisStructure::Token *, LinguisticAnalysisStructure::MorphoSyntacticData * > createAlternativeToken (const Automaton::RecognizerMatch &recognizedExpression) const
 Creates the new token corresponding to the idiomatic expression using information from the expression and from the head token of the expression.
 
bool getCompatibleProperties (const LinguisticAnalysisStructure::MorphoSyntacticData *headData, const LinguisticCode &baseProperty, std::set< LinguisticCode > &newProperties) const
 
bool isCompatible (const LinguisticCode &baseProperty, const LinguisticCode &property, LinguisticCode &newProperty) const
 
LinguisticGraphVertex addAlternativeVertex (LinguisticAnalysisStructure::Token *, LinguisticAnalysisStructure::MorphoSyntacticData *, LinguisticGraph *graph) const
 
void createBeginAlternative (LinguisticGraphVertex startVertex, LinguisticGraphVertex alternativeFirstVertex, LinguisticGraph &graph) const
 create an alternative branch
 
void attachEndOfAlternative (LinguisticGraphVertex alternativeLastVertex, LinguisticGraphVertex endVertex, LinguisticGraph &graph) const
 attach the end of an alternative to main path
 
- Protected Member Functions inherited from Lima::LinguisticProcessing::Automaton::ConstraintFunction
 ConstraintFunction (MediaId language, const LimaString &complement=LimaString())
 

Additional Inherited Members

- Protected Attributes inherited from Lima::LinguisticProcessing::Automaton::ConstraintFunction
MediaId m_language_id
 
LimaString m_complement
 

Detailed Description

Definition at line 37 of file applyRecognizerActions.h.

Constructor & Destructor Documentation

◆ CreateAlternative()

Lima::LinguisticProcessing::ApplyRecognizer::CreateAlternative::CreateAlternative ( MediaId  language,
const LimaString &  complement = LimaString() 
)

Definition at line 253 of file applyRecognizerActions.cpp.

◆ ~CreateAlternative()

virtual Lima::LinguisticProcessing::ApplyRecognizer::CreateAlternative::~CreateAlternative ( )
inlinevirtual

Definition at line 42 of file applyRecognizerActions.h.

Member Function Documentation

◆ actionNeedsRecognizedExpression()

bool Lima::LinguisticProcessing::ApplyRecognizer::CreateAlternative::actionNeedsRecognizedExpression ( )
inlineoverridevirtual

◆ addAlternativeVertex()

LinguisticGraphVertex Lima::LinguisticProcessing::ApplyRecognizer::CreateAlternative::addAlternativeVertex ( LinguisticAnalysisStructure::Token *  token,
LinguisticAnalysisStructure::MorphoSyntacticData *  data,
LinguisticGraph *  graph 
) const
protected

Definition at line 180 of file applyRecognizerActions.cpp.

◆ attachEndOfAlternative()

void Lima::LinguisticProcessing::ApplyRecognizer::CreateAlternative::attachEndOfAlternative ( LinguisticGraphVertex  alternativeLastVertex,
LinguisticGraphVertex  endVertex,
LinguisticGraph &  graph 
) const
protected

attach the end of an alternative to main path

Parameters
alternativeLastVertexlast vertex of the alternative to re-attach to the path
endVertexwhere to attach it on the graph : the endVertex is the last vertex avoided by the alternative : the alternative returns to the main path after the endVertex
graphthe graph

Definition at line 232 of file applyRecognizerActions.cpp.

◆ createAlternativeToken()

std::pair< Token *, MorphoSyntacticData * > Lima::LinguisticProcessing::ApplyRecognizer::CreateAlternative::createAlternativeToken ( const Automaton::RecognizerMatch &  recognizedExpression) const
protected

Creates the new token corresponding to the idiomatic expression using information from the expression and from the head token of the expression.

Parameters
recognizedExpressionThe recognized expression tokens

Definition at line 40 of file applyRecognizerActions.cpp.

◆ createBeginAlternative()

void Lima::LinguisticProcessing::ApplyRecognizer::CreateAlternative::createBeginAlternative ( LinguisticGraphVertex  startVertex,
LinguisticGraphVertex  alternativeFirstVertex,
LinguisticGraph &  graph 
) const
protected

create an alternative branch

Parameters
startVertexwhere to start on the graph : the start vertex is the first node to be avoided by the alternative : all previous vertices attached to this node are branched to the alternative
alternativeFirstVertexthe first vertex of the alternative
graphthe graph

Definition at line 202 of file applyRecognizerActions.cpp.

◆ getCompatibleProperties()

bool Lima::LinguisticProcessing::ApplyRecognizer::CreateAlternative::getCompatibleProperties ( const LinguisticAnalysisStructure::MorphoSyntacticData *  headData,
const LinguisticCode &  baseProperty,
std::set< LinguisticCode > &  newProperties 
) const
protected

Definition at line 137 of file applyRecognizerActions.cpp.

◆ isCompatible()

bool Lima::LinguisticProcessing::ApplyRecognizer::CreateAlternative::isCompatible ( const LinguisticCode &  baseProperty,
const LinguisticCode &  property,
LinguisticCode &  newProperty 
) const
protected

Definition at line 154 of file applyRecognizerActions.cpp.

◆ operator()()

bool Lima::LinguisticProcessing::ApplyRecognizer::CreateAlternative::operator() ( Automaton::RecognizerMatch &  ,
AnalysisContent &   
) const
overridevirtual

zero-ary constraint function : applies the function without a vertex indication (used for actions, not constraints -> applied only at end, when a match is found: uses the result of the match

Returns
true if the action of the function succeeded, false otherwise

Reimplemented from Lima::LinguisticProcessing::Automaton::ConstraintFunction.

Reimplemented in Lima::LinguisticProcessing::MorphologicAnalysis::CreateIdiomaticAlternative.

Definition at line 275 of file applyRecognizerActions.cpp.


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