LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
basicConstraintFunctions.h
Go to the documentation of this file.
1
// Copyright 2002-2013 CEA LIST
2
// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3
//
4
// SPDX-License-Identifier: MIT
5
6
/************************************************************************
7
*
8
* @file basicConstraintFunctions.h
9
* @author Besancon Romaric (besanconr@zoe.cea.fr)
10
* @date Wed Mar 16 2005
11
* @version $Id$
12
* copyright Copyright (C) 2005-2012 by CEA LIST
13
* Project Automaton
14
*
15
* @brief this file contains the definitions of several basic
16
* constraint functions (agreement etc)
17
*
18
*
19
***********************************************************************/
20
21
#ifndef BASICCONSTRAINTFUNCTIONS_H
22
#define BASICCONSTRAINTFUNCTIONS_H
23
24
#include "
AutomatonExport.h
"
25
#include "
constraintFunction.h
"
26
27
namespace
Lima
{
28
namespace
LinguisticProcessing {
29
namespace
Automaton {
30
31
//**********************************************************************
32
// ids of constraints defined in this file
33
#define AgreementConstraintId "AgreementConstraint"
34
#define GenderAgreementId "GenderAgreement"
35
#define NumberAgreementId "NumberAgreement"
36
#define LinguisticPropertyIsId "LinguisticPropertyIs"
37
#define LengthInIntervalId "LengthInInterval"
38
#define NumericValueInIntervalId "NumericValueInIntervalId"
39
#define NoSpaceWithId "NoSpaceWith"
40
46
class
LIMA_AUTOMATON_EXPORT
AgreementConstraint
:
public
ConstraintFunction
47
{
48
public
:
49
AgreementConstraint
(MediaId language,
50
const
LimaString
& complement=
LimaString
());
51
~AgreementConstraint
() {}
52
bool
operator()(
const
LinguisticAnalysisStructure::AnalysisGraph
& graph,
53
const
LinguisticGraphVertex
& v1,
54
const
LinguisticGraphVertex
& v2,
55
AnalysisContent
& analysis)
const override
;
56
private
:
57
const
Common::PropertyCode::PropertyAccessor
* m_categoryForAgreementAccessor;
58
};
59
60
// specializations of agreement constraints
61
class
LIMA_AUTOMATON_EXPORT
GenderAgreement
:
public
AgreementConstraint
62
{
63
public
:
64
GenderAgreement
(MediaId language,
65
const
LimaString
& complement=
LimaString
());
66
~GenderAgreement
() {}
67
private
:
68
};
69
70
class
LIMA_AUTOMATON_EXPORT
NumberAgreement
:
public
AgreementConstraint
71
{
72
public
:
73
NumberAgreement
(MediaId language,
74
const
LimaString
& complement=
LimaString
());
75
~NumberAgreement
() {}
76
private
:
77
};
78
84
class
LIMA_AUTOMATON_EXPORT
LinguisticPropertyIs
:
public
ConstraintFunction
85
{
86
public
:
87
LinguisticPropertyIs
(MediaId language,
88
const
LimaString
& complement=
LimaString
());
89
~LinguisticPropertyIs
() {}
90
bool
operator()(
const
LinguisticAnalysisStructure::AnalysisGraph
& graph,
91
const
LinguisticGraphVertex
& v,
92
AnalysisContent
& analysis)
const override
;
93
94
private
:
95
const
Common::PropertyCode::PropertyAccessor
* m_propertyAccessor;
96
std::vector<std::pair<LinguisticCode,LinguisticProcessing::LinguisticAnalysisStructure::MorphoSyntacticType> > m_values;
97
};
98
102
class
LIMA_AUTOMATON_EXPORT
LengthInInterval
:
public
ConstraintFunction
103
{
104
public
:
105
LengthInInterval
(MediaId language,
106
const
LimaString
& complement=
LimaString
());
107
~LengthInInterval
() {}
108
bool
operator()(
const
LinguisticAnalysisStructure::AnalysisGraph
& graph,
109
const
LinguisticGraphVertex
& v,
110
AnalysisContent
& analysis)
const override
;
111
112
private
:
113
uint64_t m_min;
114
uint64_t m_max;
115
};
116
120
class
LIMA_AUTOMATON_EXPORT
NumericValueInInterval
:
public
ConstraintFunction
121
{
122
public
:
123
NumericValueInInterval
(MediaId language,
124
const
LimaString
& complement=
LimaString
());
125
~NumericValueInInterval
() {}
126
bool
operator()(
const
LinguisticAnalysisStructure::AnalysisGraph
& graph,
127
const
LinguisticGraphVertex
& v,
128
AnalysisContent
& analysis)
const override
;
129
130
private
:
131
MediaId m_language;
132
uint64_t m_min;
133
uint64_t m_max;
134
};
135
136
/* check if the considered token has no whitespace separator with the other token
137
* (e.g. '-' is a minus sign if not separated from following number)
138
*/
139
class
LIMA_AUTOMATON_EXPORT
NoSpaceWith
:
public
ConstraintFunction
140
{
141
public
:
142
NoSpaceWith
(MediaId language,
143
const
LimaString
& complement=
LimaString
());
144
~NoSpaceWith
() {}
145
bool
operator()(
const
LinguisticAnalysisStructure::AnalysisGraph
& graph,
146
const
LinguisticGraphVertex
& v1,
147
const
LinguisticGraphVertex
& v2,
148
AnalysisContent
& analysis)
const override
;
149
private
:
150
};
151
152
153
}
// end namespace
154
}
// end namespace
155
}
// end namespace
156
157
#endif
AutomatonExport.h
LIMA_AUTOMATON_EXPORT
#define LIMA_AUTOMATON_EXPORT
Definition
AutomatonExport.h:27
LinguisticGraphVertex
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
Definition
LinguisticGraph.h:100
Lima::AnalysisContent
Holds all data that pass through the ProcessUnits Analysis data are shared pointers,...
Definition
AnalysisContent.h:37
Lima::Common::PropertyCode::PropertyAccessor
Provide function to read write and check a property.
Definition
PropertyAccessor.h:31
Lima::LinguisticProcessing::Automaton::AgreementConstraint
generic agreement constraint function: complement must contain the element on which the agreement mus...
Definition
basicConstraintFunctions.h:47
Lima::LinguisticProcessing::Automaton::AgreementConstraint::~AgreementConstraint
~AgreementConstraint()
Definition
basicConstraintFunctions.h:51
Lima::LinguisticProcessing::Automaton::ConstraintFunction
Definition
constraintFunction.h:37
Lima::LinguisticProcessing::Automaton::GenderAgreement
Definition
basicConstraintFunctions.h:62
Lima::LinguisticProcessing::Automaton::GenderAgreement::~GenderAgreement
~GenderAgreement()
Definition
basicConstraintFunctions.h:66
Lima::LinguisticProcessing::Automaton::LengthInInterval
test the length of the inflected form of the word
Definition
basicConstraintFunctions.h:103
Lima::LinguisticProcessing::Automaton::LengthInInterval::~LengthInInterval
~LengthInInterval()
Definition
basicConstraintFunctions.h:107
Lima::LinguisticProcessing::Automaton::LinguisticPropertyIs
test the value of a linguistic property
Definition
basicConstraintFunctions.h:85
Lima::LinguisticProcessing::Automaton::LinguisticPropertyIs::~LinguisticPropertyIs
~LinguisticPropertyIs()
Definition
basicConstraintFunctions.h:89
Lima::LinguisticProcessing::Automaton::NoSpaceWith
Definition
basicConstraintFunctions.h:140
Lima::LinguisticProcessing::Automaton::NoSpaceWith::~NoSpaceWith
~NoSpaceWith()
Definition
basicConstraintFunctions.h:144
Lima::LinguisticProcessing::Automaton::NumberAgreement
Definition
basicConstraintFunctions.h:71
Lima::LinguisticProcessing::Automaton::NumberAgreement::~NumberAgreement
~NumberAgreement()
Definition
basicConstraintFunctions.h:75
Lima::LinguisticProcessing::Automaton::NumericValueInInterval
test the length of the inflected form of the word
Definition
basicConstraintFunctions.h:121
Lima::LinguisticProcessing::Automaton::NumericValueInInterval::~NumericValueInInterval
~NumericValueInInterval()
Definition
basicConstraintFunctions.h:125
Lima::LinguisticProcessing::LinguisticAnalysisStructure::AnalysisGraph
An AnalysisData containing a LinguisticGraph with a language and an id.
Definition
AnalysisGraph.h:47
constraintFunction.h
Lima
NAUTITIA.
Definition
AmosePluginsManager.h:15
Lima::LimaString
QString LimaString
Definition
LimaString.h:33
lima_linguisticprocessing
src
linguisticProcessing
core
Automaton
basicConstraintFunctions.h
Generated by
1.9.8