LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
applyRecognizerActions.h
Go to the documentation of this file.
1// Copyright 2002-2020 CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
6/************************************************************************
7 *
8 * @file applyRecognizerActions.h
9 * @author besancon (besanconr@zoe.cea.fr)
10 * @date Tue Jan 25 2005
11 * copyright Copyright (C) 2005-2020 by CEA LIST
12 * Project s2lp
13 *
14 * @brief this class contains actions used by ApplyRecognizer process unit
15 *
16 *
17 ***********************************************************************/
18
19#ifndef APPLYRECOGNIZERACTIONS_H
20#define APPLYRECOGNIZERACTIONS_H
21
26
27namespace Lima {
28namespace LinguisticProcessing {
29namespace ApplyRecognizer {
30
31//**********************************************************************
32// ids for actions defined in this filex
33#define CreateAlternativeId "CreateAlternative"
34#define StoreInDataId "StoreInData"
35
36//**********************************************************************
38{
39public:
40 CreateAlternative(MediaId language,
41 const LimaString& complement=LimaString());
42 virtual ~CreateAlternative() {}
43 virtual bool operator()(Automaton::RecognizerMatch& result,
44 AnalysisContent& analysis) const override;
45
46 bool actionNeedsRecognizedExpression() override { return true; }
47
48private:
49 const Common::PropertyCode::PropertyAccessor* m_macroAccessor;
50 const Common::PropertyCode::PropertyCodeManager* m_propertyCodeManager;
51 FsaStringsPool* m_stringsPool;
52
53protected:
54// protected member functions
55
63 createAlternativeToken(const Automaton::RecognizerMatch& recognizedExpression) const;
64
65 bool getCompatibleProperties(const LinguisticAnalysisStructure::MorphoSyntacticData* headData,
66 const LinguisticCode& baseProperty,
67 std::set<LinguisticCode>& newProperties) const;
68 bool isCompatible(const LinguisticCode& baseProperty,
69 const LinguisticCode& property,
70 LinguisticCode& newProperty) const;
72 addAlternativeVertex(LinguisticAnalysisStructure::Token*,
74 LinguisticGraph* graph) const;
75 void createBeginAlternative(LinguisticGraphVertex startVertex,
76 LinguisticGraphVertex alternativeFirstVertex,
77 LinguisticGraph& graph) const;
78 void attachEndOfAlternative(LinguisticGraphVertex alternativeLastVertex,
79 LinguisticGraphVertex endVertex,
80 LinguisticGraph& graph) const;
81};
82
83//**********************************************************************
85{
86public:
87 StoreInData(MediaId language,
88 const LimaString& complement);
90 bool operator()(Automaton::RecognizerMatch& result,
91 AnalysisContent& analysis) const override;
92
93 bool actionNeedsRecognizedExpression() override { return true; }
94private:
95};
96
97
98} // end namespace
99} // end namespace
100} // end namespace
101
102#endif
#define LIMA_APPLYRECOGNIZER_EXPORT
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, LinguisticVertexProperties > LinguisticGraph
Property to identify the chains in the graph.
Holds all data that pass through the ProcessUnits Analysis data are shared pointers,...
Provide function to read write and check a property.
Provide tools to parse a property file, and deal with the property coding system.
SimpleFactory< MediaProcessUnit, ApplyRecognizer > ApplyRecognizer(APPLYRECOGNIZER_CLASSID)
NAUTITIA.
QString LimaString
Definition LimaString.h:33