179 if (!
m_left.getBestMatch(graph, leftContext, leftLimit,
187 if (!
m_right.getBestMatch(graph, rightContext, rightLimit,
203 if (!
m_left.getAllMatches(graph, leftContext, leftLimit,
204 analysis,leftMatches,
205 constraintCheckList,forward,backward,
215 Automaton::AutomatonMatchSet::const_iterator
216 currentLeftMatch=leftMatches.begin(),
217 endLeftMatch=leftMatches.end();
221 std::set<ConstraintCheckList> leftCheckLists;
223 for (; currentLeftMatch!=endLeftMatch; currentLeftMatch++) {
229 if (leftCheckLists.find((*currentLeftMatch).second)!=
230 leftCheckLists.end()) {
235 constraintCheckList=(*currentLeftMatch).second;
236 if (
m_right.getBestMatch(graph, rightContext, rightLimit,
237 analysis,rightmatch,constraintCheckList,
239 leftmatch=(*currentLeftMatch).first;
241 std::reverse(leftmatch.begin(),leftmatch.end());
245 leftCheckLists.insert((*currentLeftMatch).second);
262 LDEBUG <<
"Rule::executeActions: start";
264 LDEBUG <<
"result = " << *result;
266 LDEBUG <<
"result = NULL";
279 LDEBUG <<
"Rule::executeActions: success = " << success
280 <<
", check if execution is required for function " << actionItr->second.functionName();
284 const LimaString& ruelElemtId = actionItr->first;
286 LDEBUG <<
"Rule::executeActions: check " << ruelElemtId <<
"for function " << actionItr->second.functionName();
290 for( std::vector<MatchElement>::iterator matchElmt = result->begin() ;
291 matchElmt != result->end() ; matchElmt++ ) {
293 LDEBUG <<
"Rule::executeActions: check vertex "
294 << matchElmt->m_elem.first <<
" with " << matchElmt->getRuleElemtId();
296 if( (matchElmt->getRuleElemtId()).startsWith(ruelElemtId) ) {
298 LDEBUG <<
"Rule::executeActions: found " << matchElmt->m_elem.first;
300 bool ok=(*functionAddr)(graph,matchElmt->m_elem.first,analysis);
303 LERROR <<
"Rule::executeActions: execution of function" << actionItr->second.functionName() <<
"failed";
310 LDEBUG <<
"Rule::executeActions: execution of function" << actionItr->second.functionName() <<
"not required";
316 for (std::vector<Constraint>::const_iterator action=
m_actions.begin();
319 if (! (*action).apply(graph,analysis,
339 for (std::vector<Constraint>::const_iterator action=r.
m_actions.begin();
341 os << *action << endl;
345 os <<
"(" << (*action).first.toUtf8().data() <<
","<< (*action).second<<
")" << endl;
355 for (std::vector<Constraint>::const_iterator action=r.
m_actions.begin();
361 os <<
"(" << action->first <<
","<< action->second<<
")" <<
QTENDL;
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
Holds all data that pass through the ProcessUnits Analysis data are shared pointers,...
std::string toString() const
␈rief a class for control parameters for the search using the automata
␈rief A class for the description of automata
std::set< AutomatonMatch, CompareAutomatonMatch > AutomatonMatchSet
Automaton const & leftAutomaton() const
bool m_hasLeftRightConstraint
uint64_t m_numberOfConstraints
uint64_t numberOfConstraints() const
Automaton const & rightAutomaton() const
const std::string & getRuleId() const
std::vector< Constraint > m_actions
bool operator<(const Rule &r)
LinguisticCode getLinguisticProperties() const
LimaString m_normalizedForm
Rule & operator=(const Rule &)
TransitionUnit * m_trigger
const LimaString & getNormalizedForm() const
Common::MediaticData::EntityType m_type
LinguisticCode m_lingProp
const std::vector< Constraint > & getActions() const
TransitionUnit * getTrigger() const
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 righ...
std::vector< std::pair< LimaString, Constraint > > m_actionsWithOneArgument
Common::MediaticData::EntityType getType() const
bool executeActions(const LinguisticAnalysisStructure::AnalysisGraph &graph, AnalysisContent &analysis, ConstraintCheckList &constraintCheckList, const bool success, RecognizerMatch *result) const
const std::vector< std::pair< LimaString, Constraint > > & getActionsWithOneArgument() const
virtual TransitionUnit * clone() const =0
An AnalysisData containing a LinguisticGraph with a language and an id.
@ EXECUTE_IF_FAILURE_REVERSE
@ EXECUTE_IF_SUCCESS_REVERSE
std::ostream & operator<<(std::ostream &os, const DFFSPos &x)
@ FORWARDSEARCH
forward search in the graph
@ BACKWARDSEARCH
backward search in the graph
std::vector< ConstraintCheckListElement > ConstraintCheckList