36namespace LinguisticProcessing {
54#define DEFAULT_OVERLAP_STRATEGY IGNORE_FIRST
68#define RECOGNIZER_CLASSID "AutomatonRecognizer"
97 uint64_t numberOfRules()
const;
106 uint64_t addRuleInStorage(
Rule* rule);
160 std::vector<RecognizerMatch>& result,
161 bool testAllVertices=
false,
162 bool stopAtFirstSuccess=
true,
163 bool onlyOneSuccessPerType=
false,
164 bool returnAtFirstSuccess=
false,
165 bool applySameRuleWhileSuccess=
false)
const;
200 std::vector<RecognizerMatch>& result,
201 bool testAllVertices,
202 bool stopAtFirstSuccess,
203 bool onlyOneSuccessPerType,
204 bool returnAtFirstSuccess,
205 bool applySameRuleWhileSuccess)
const;
225 std::vector<RecognizerMatch>& result,
226 bool stopAtFirstSuccess=
true,
227 bool onlyOneSuccessPerType=
false,
228 bool applySameRuleWhileSuccess=
false)
const;
241 resolveOverlappingEntities(std::vector<RecognizerMatch>& listEntities,
295 std::vector<RecognizerMatch>& match,
296 std::set<Common::MediaticData::EntityType>* forbiddenTypes=0,
297 bool stopAtFirstSuccess=
true,
298 bool onlyOneSuccessPerType=
false,
299 bool applySameRuleWhileSuccess=
false)
const ;
305 void listTriggers()
const;
310 void initializeSearchStructure();
316 class TriggerRule :
public std::pair<TransitionUnit*, SetOfRules> {
328 class CompareTriggerRule;
346 void clearSearchStructure();
354 std::vector<TriggerRule*>& matchingSetOfRules)
const;
362 void setNormalizedForm(
const LimaString& norm,
366 uint64_t findRuleIndex(
Rule*)
const;
#define LIMA_AUTOMATON_EXPORT
QDebug & operator<<(QDebug &qd, const std::string &str)
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
Holds all data that pass through the ProcessUnits Analysis data are shared pointers,...
Manage initialization of InitializableObjects using configuration module and parameters.
␈rief a class for control parameters for the search using the automata
TriggerRule(TransitionUnit *t, const SetOfRules &s)
void setTransitionUnit(TransitionUnit *t)
SetOfRules & setOfRules()
TransitionUnit * transitionUnit() const
const SetOfRules & setOfRules() const
␈rief a class for the definition of a complete recognizer
TransitionSearchStructure< TriggerRule > m_searchStructure
std::vector< TriggerRule > m_rules
uint64_t numberOfRules() const
AutomatonControlParams m_automatonControlParams
parameters to control the search of the automaton
void init(Common::XMLConfigurationFiles::GroupConfigurationStructure &unitConfiguration, Manager *manager) override
initialize with parameters from configuration file.
An AnalysisData containing a LinguisticGraph with a language and an id.
Holds morphosyntactic informations.
holds surface data of a token
OverlapResolutionStrategy
an enumerated type to indicate which kind of strategy adopt to deal with two overlapping entities
@ IGNORE_SECOND
the second entity is ignored => assumes the leftmost trigger is more important
@ IGNORE_SMALLEST
the smallest entity is ignored (the one that covers the smallest number of words is assumed to be les...
@ KEEP_ALL_OVERLAPS
do not try to avoid overlaps, find the largest number of entities possible
@ IGNORE_FIRST
the first entity is ignored => assumes the rightmost trigger is more important
std::vector< Rule * > SetOfRules
the SetOfRules type is defined as a vector of pointers on Rule
#define DEFAULT_OVERLAP_STRATEGY