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

#include <linguisticProcessing/core/Automaton/rule.h>

Public Member Functions

 Rule ()
 
 Rule (const Rule &)
 
 ~Rule ()
 
Rule & operator= (const Rule &)
 
bool operator< (const Rule &r)
 
void reinit ()
 
TransitionUnit * getTrigger () const
 
Automaton const & leftAutomaton () const
 
Automaton const & rightAutomaton () const
 
Common::MediaticData::EntityType getType () const
 
LinguisticCode getLinguisticProperties () const
 
const LimaString & getNormalizedForm () const
 
uint64_t numberOfConstraints () const
 
bool contextual () const
 
bool negative () const
 
const std::vector< Constraint > & getActions () const
 
const std::vector< std::pair< LimaString, Constraint > > & getActionsWithOneArgument () const
 
double getWeight () const
 
const std::string & getRuleId () const
 
void setTrigger (TransitionUnit *)
 
void setLeftAutomaton (const Automaton &)
 
void setRightAutomaton (const Automaton &)
 
void setType (const Common::MediaticData::EntityType &)
 
void setLinguisticProperties (const LinguisticCode &)
 
void setNormalizedForm (const LimaString &)
 
void setNumberOfConstraints (const uint64_t)
 
void incrementNumberOfConstraints ()
 
void setContextual (const bool)
 
void setNegative (const bool)
 
void addAction (const Constraint &c)
 
void addAction (const Constraint &c, const LimaString &ruleElemntId)
 
void setWeight (const double &w)
 
void setHasLeftRightConstraint (const bool v)
 
void setRuleId (const std::string &ruleId)
 
bool test (const LinguisticProcessing::LinguisticAnalysisStructure::AnalysisGraph &graph, const LinguisticGraphVertex &leftContext, const LinguisticGraphVertex &rightContext, const LinguisticGraphVertex &leftLimit, const LinguisticGraphVertex &rightLimit, AnalysisContent &analysis, RecognizerMatch &leftmatch, RecognizerMatch &rightmatch, ConstraintCheckList &, ForwardSearch &forward, BackwardSearch &backward, const AutomatonControlParams &controlParams) const
 test the rule on a morphological graph : the trigger has already been tested: test only left and right context
 
bool executeActions (const LinguisticAnalysisStructure::AnalysisGraph &graph, AnalysisContent &analysis, ConstraintCheckList &constraintCheckList, const bool success, RecognizerMatch *result) const
 

Protected Member Functions

void init ()
 
void copy (const Rule &r)
 
void freeMem ()
 

Protected Attributes

TransitionUnit * m_trigger
 
Automaton m_left
 
Automaton m_right
 
Common::MediaticData::EntityType m_type
 
LinguisticCode m_lingProp
 
LimaString m_normalizedForm
 
uint64_t m_numberOfConstraints
 
bool m_contextual
 
bool m_negative
 
bool m_hasLeftRightConstraint
 
std::vector< Constraint > m_actions
 
std::vector< std::pair< LimaString, Constraint > > m_actionsWithOneArgument
 
double m_weight
 
std::string m_ruleId
 

Friends

class AutomatonReader
 
class AutomatonWriter
 
LIMA_AUTOMATON_EXPORT std::ostream & operator<< (std::ostream &, const Rule &)
 
LIMA_AUTOMATON_EXPORT QDebug & operator<< (QDebug &, const Rule &)
 

Detailed Description

Definition at line 37 of file rule.h.

Constructor & Destructor Documentation

◆ Rule() [1/2]

Lima::LinguisticProcessing::Automaton::Rule::Rule ( )

Definition at line 32 of file rule.cpp.

◆ Rule() [2/2]

Lima::LinguisticProcessing::Automaton::Rule::Rule ( const Rule &  r)

Definition at line 49 of file rule.cpp.

◆ ~Rule()

Lima::LinguisticProcessing::Automaton::Rule::~Rule ( )

Definition at line 76 of file rule.cpp.

Member Function Documentation

◆ addAction() [1/2]

void Lima::LinguisticProcessing::Automaton::Rule::addAction ( const Constraint &  c)
inline

Definition at line 195 of file rule.h.

◆ addAction() [2/2]

void Lima::LinguisticProcessing::Automaton::Rule::addAction ( const Constraint &  c,
const LimaString &  ruleElemntId 
)
inline

Definition at line 198 of file rule.h.

◆ contextual()

bool Lima::LinguisticProcessing::Automaton::Rule::contextual ( ) const
inline

Definition at line 174 of file rule.h.

◆ copy()

void Lima::LinguisticProcessing::Automaton::Rule::copy ( const Rule &  r)
protected

Definition at line 133 of file rule.cpp.

◆ executeActions()

bool Lima::LinguisticProcessing::Automaton::Rule::executeActions ( const LinguisticAnalysisStructure::AnalysisGraph &  graph,
AnalysisContent &  analysis,
ConstraintCheckList &  constraintCheckList,
const bool  success,
RecognizerMatch *  result 
) const

Definition at line 250 of file rule.cpp.

◆ freeMem()

void Lima::LinguisticProcessing::Automaton::Rule::freeMem ( )
protected

Definition at line 151 of file rule.cpp.

◆ getActions()

const std::vector< Constraint > & Lima::LinguisticProcessing::Automaton::Rule::getActions ( ) const
inline

Definition at line 167 of file rule.h.

◆ getActionsWithOneArgument()

const std::vector< std::pair< LimaString, Constraint > > & Lima::LinguisticProcessing::Automaton::Rule::getActionsWithOneArgument ( ) const
inline

Definition at line 170 of file rule.h.

◆ getLinguisticProperties()

LinguisticCode Lima::LinguisticProcessing::Automaton::Rule::getLinguisticProperties ( ) const
inline

Definition at line 161 of file rule.h.

◆ getNormalizedForm()

const LimaString & Lima::LinguisticProcessing::Automaton::Rule::getNormalizedForm ( ) const
inline

Definition at line 163 of file rule.h.

◆ getRuleId()

const std::string & Lima::LinguisticProcessing::Automaton::Rule::getRuleId ( ) const
inline

Definition at line 67 of file rule.h.

◆ getTrigger()

TransitionUnit * Lima::LinguisticProcessing::Automaton::Rule::getTrigger ( ) const
inline

Definition at line 157 of file rule.h.

◆ getType()

Common::MediaticData::EntityType Lima::LinguisticProcessing::Automaton::Rule::getType ( ) const
inline

Definition at line 160 of file rule.h.

◆ getWeight()

double Lima::LinguisticProcessing::Automaton::Rule::getWeight ( ) const
inline

Definition at line 66 of file rule.h.

◆ incrementNumberOfConstraints()

void Lima::LinguisticProcessing::Automaton::Rule::incrementNumberOfConstraints ( )
inline

Definition at line 182 of file rule.h.

◆ init()

void Lima::LinguisticProcessing::Automaton::Rule::init ( )
protected

Definition at line 115 of file rule.cpp.

◆ leftAutomaton()

Automaton const & Lima::LinguisticProcessing::Automaton::Rule::leftAutomaton ( ) const
inline

Definition at line 158 of file rule.h.

◆ negative()

bool Lima::LinguisticProcessing::Automaton::Rule::negative ( ) const
inline

Definition at line 177 of file rule.h.

◆ numberOfConstraints()

uint64_t Lima::LinguisticProcessing::Automaton::Rule::numberOfConstraints ( ) const
inline

Definition at line 165 of file rule.h.

◆ operator<()

bool Lima::LinguisticProcessing::Automaton::Rule::operator< ( const Rule &  r)

Definition at line 109 of file rule.cpp.

◆ operator=()

Rule & Lima::LinguisticProcessing::Automaton::Rule::operator= ( const Rule &  r)

Definition at line 100 of file rule.cpp.

◆ reinit()

void Lima::LinguisticProcessing::Automaton::Rule::reinit ( )

Definition at line 80 of file rule.cpp.

◆ rightAutomaton()

Automaton const & Lima::LinguisticProcessing::Automaton::Rule::rightAutomaton ( ) const
inline

Definition at line 159 of file rule.h.

◆ setContextual()

void Lima::LinguisticProcessing::Automaton::Rule::setContextual ( const bool  c)
inline

Definition at line 175 of file rule.h.

◆ setHasLeftRightConstraint()

void Lima::LinguisticProcessing::Automaton::Rule::setHasLeftRightConstraint ( const bool  v)
inline

Definition at line 82 of file rule.h.

◆ setLeftAutomaton()

void Lima::LinguisticProcessing::Automaton::Rule::setLeftAutomaton ( const Automaton &  a)
inline

Definition at line 186 of file rule.h.

◆ setLinguisticProperties()

void Lima::LinguisticProcessing::Automaton::Rule::setLinguisticProperties ( const LinguisticCode &  l)
inline

Definition at line 189 of file rule.h.

◆ setNegative()

void Lima::LinguisticProcessing::Automaton::Rule::setNegative ( const bool  c)
inline

Definition at line 178 of file rule.h.

◆ setNormalizedForm()

void Lima::LinguisticProcessing::Automaton::Rule::setNormalizedForm ( const LimaString &  s)
inline

Definition at line 192 of file rule.h.

◆ setNumberOfConstraints()

void Lima::LinguisticProcessing::Automaton::Rule::setNumberOfConstraints ( const uint64_t  n)
inline

Definition at line 179 of file rule.h.

◆ setRightAutomaton()

void Lima::LinguisticProcessing::Automaton::Rule::setRightAutomaton ( const Automaton &  a)
inline

Definition at line 187 of file rule.h.

◆ setRuleId()

void Lima::LinguisticProcessing::Automaton::Rule::setRuleId ( const std::string &  ruleId)
inline

Definition at line 84 of file rule.h.

◆ setTrigger()

void Lima::LinguisticProcessing::Automaton::Rule::setTrigger ( TransitionUnit *  t)
inline

Definition at line 185 of file rule.h.

◆ setType()

void Lima::LinguisticProcessing::Automaton::Rule::setType ( const Common::MediaticData::EntityType &  t)
inline

Definition at line 188 of file rule.h.

◆ setWeight()

void Lima::LinguisticProcessing::Automaton::Rule::setWeight ( const double &  w)
inline

Definition at line 81 of file rule.h.

◆ test()

bool Lima::LinguisticProcessing::Automaton::Rule::test ( const LinguisticProcessing::LinguisticAnalysisStructure::AnalysisGraph &  graph,
const LinguisticGraphVertex &  leftContext,
const LinguisticGraphVertex &  rightContext,
const LinguisticGraphVertex &  leftLimit,
const LinguisticGraphVertex &  rightLimit,
AnalysisContent &  analysis,
RecognizerMatch &  leftmatch,
RecognizerMatch &  rightmatch,
ConstraintCheckList &  constraintCheckList,
ForwardSearch &  forward,
BackwardSearch &  backward,
const AutomatonControlParams &  controlParams 
) const

test the rule on a morphological graph : the trigger has already been tested: test only left and right context

Parameters
graphthe graph
leftContextthe vertex at the beginning of the left context
rightContextthe vertex at the beginning of the right context
leftLimitthe limit vertex for the left context
rightLimitthe limit vertex for the right context
analysisthe content of the analysis (may be modified)
leftmatchthe resulting match for left context
rightmatchthe resulting match for right context
Returns
true if a match was found, false otherwise

Definition at line 162 of file rule.cpp.

Friends And Related Symbol Documentation

◆ AutomatonReader

friend class AutomatonReader
friend

Definition at line 39 of file rule.h.

◆ AutomatonWriter

friend class AutomatonWriter
friend

Definition at line 40 of file rule.h.

◆ operator<< [1/2]

LIMA_AUTOMATON_EXPORT QDebug & operator<< ( QDebug &  os,
const Rule &  r 
)
friend

Definition at line 349 of file rule.cpp.

◆ operator<< [2/2]

LIMA_AUTOMATON_EXPORT std::ostream & operator<< ( std::ostream &  os,
const Rule &  r 
)
friend

Definition at line 333 of file rule.cpp.

Member Data Documentation

◆ m_actions

std::vector<Constraint> Lima::LinguisticProcessing::Automaton::Rule::m_actions
protected

Definition at line 139 of file rule.h.

◆ m_actionsWithOneArgument

std::vector<std::pair<LimaString,Constraint> > Lima::LinguisticProcessing::Automaton::Rule::m_actionsWithOneArgument
protected

Definition at line 140 of file rule.h.

◆ m_contextual

bool Lima::LinguisticProcessing::Automaton::Rule::m_contextual
protected

Definition at line 133 of file rule.h.

◆ m_hasLeftRightConstraint

bool Lima::LinguisticProcessing::Automaton::Rule::m_hasLeftRightConstraint
protected

Definition at line 137 of file rule.h.

◆ m_left

Automaton Lima::LinguisticProcessing::Automaton::Rule::m_left
protected

Definition at line 126 of file rule.h.

◆ m_lingProp

LinguisticCode Lima::LinguisticProcessing::Automaton::Rule::m_lingProp
protected

Definition at line 129 of file rule.h.

◆ m_negative

bool Lima::LinguisticProcessing::Automaton::Rule::m_negative
protected

Definition at line 136 of file rule.h.

◆ m_normalizedForm

LimaString Lima::LinguisticProcessing::Automaton::Rule::m_normalizedForm
protected

Definition at line 131 of file rule.h.

◆ m_numberOfConstraints

uint64_t Lima::LinguisticProcessing::Automaton::Rule::m_numberOfConstraints
protected

Definition at line 132 of file rule.h.

◆ m_right

Automaton Lima::LinguisticProcessing::Automaton::Rule::m_right
protected

Definition at line 127 of file rule.h.

◆ m_ruleId

std::string Lima::LinguisticProcessing::Automaton::Rule::m_ruleId
protected

Definition at line 143 of file rule.h.

◆ m_trigger

TransitionUnit* Lima::LinguisticProcessing::Automaton::Rule::m_trigger
protected

Definition at line 125 of file rule.h.

◆ m_type

Common::MediaticData::EntityType Lima::LinguisticProcessing::Automaton::Rule::m_type
protected

Definition at line 128 of file rule.h.

◆ m_weight

double Lima::LinguisticProcessing::Automaton::Rule::m_weight
protected

Definition at line 142 of file rule.h.


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