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
27namespace Lima {
28namespace LinguisticProcessing {
29namespace 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
47{
48public:
49 AgreementConstraint(MediaId language,
50 const LimaString& complement=LimaString());
52 bool operator()(const LinguisticAnalysisStructure::AnalysisGraph& graph,
53 const LinguisticGraphVertex& v1,
54 const LinguisticGraphVertex& v2,
55 AnalysisContent& analysis) const override;
56private:
57 const Common::PropertyCode::PropertyAccessor* m_categoryForAgreementAccessor;
58};
59
60// specializations of agreement constraints
62{
63public:
64 GenderAgreement(MediaId language,
65 const LimaString& complement=LimaString());
67private:
68};
69
71{
72public:
73 NumberAgreement(MediaId language,
74 const LimaString& complement=LimaString());
76private:
77};
78
85{
86public:
87 LinguisticPropertyIs(MediaId language,
88 const LimaString& complement=LimaString());
90 bool operator()(const LinguisticAnalysisStructure::AnalysisGraph& graph,
91 const LinguisticGraphVertex& v,
92 AnalysisContent& analysis) const override;
93
94private:
95 const Common::PropertyCode::PropertyAccessor* m_propertyAccessor;
96 std::vector<std::pair<LinguisticCode,LinguisticProcessing::LinguisticAnalysisStructure::MorphoSyntacticType> > m_values;
97};
98
103{
104public:
105 LengthInInterval(MediaId language,
106 const LimaString& complement=LimaString());
108 bool operator()(const LinguisticAnalysisStructure::AnalysisGraph& graph,
109 const LinguisticGraphVertex& v,
110 AnalysisContent& analysis) const override;
111
112private:
113 uint64_t m_min;
114 uint64_t m_max;
115};
116
121{
122public:
123 NumericValueInInterval(MediaId language,
124 const LimaString& complement=LimaString());
126 bool operator()(const LinguisticAnalysisStructure::AnalysisGraph& graph,
127 const LinguisticGraphVertex& v,
128 AnalysisContent& analysis) const override;
129
130private:
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 */
140{
141public:
142 NoSpaceWith(MediaId language,
143 const LimaString& complement=LimaString());
145 bool operator()(const LinguisticAnalysisStructure::AnalysisGraph& graph,
146 const LinguisticGraphVertex& v1,
147 const LinguisticGraphVertex& v2,
148 AnalysisContent& analysis) const override;
149private:
150};
151
152
153} // end namespace
154} // end namespace
155} // end namespace
156
157#endif
#define LIMA_AUTOMATON_EXPORT
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
Holds all data that pass through the ProcessUnits Analysis data are shared pointers,...
Provide function to read write and check a property.
generic agreement constraint function: complement must contain the element on which the agreement mus...
test the length of the inflected form of the word
An AnalysisData containing a LinguisticGraph with a language and an id.
NAUTITIA.
QString LimaString
Definition LimaString.h:33