LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
MorphoSyntacticDataUtils.cpp
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 * Copyright (C) 2004-2012 by CEA LIST *
8 * *
9 ***************************************************************************/
10
12
13namespace Lima {
14
15namespace LinguisticProcessing {
16
17namespace LinguisticAnalysisStructure {
18
19bool ltString::operator()(const LinguisticElement& elem1,const LinguisticElement& elem2) const
20{
21 if (elem1.type != elem2.type) return elem1.type < elem2.type;
22 if (elem1.inflectedForm != elem2.inflectedForm) return elem1.inflectedForm < elem2.inflectedForm;
23 if (elem1.lemma != elem2.lemma) return elem1.lemma < elem2.lemma;
24 if (elem1.normalizedForm != elem2.normalizedForm) return elem1.normalizedForm < elem2.normalizedForm;
25 return elem1.properties < elem2.properties;
26}
27
31
32bool ltProperty::operator()(const LinguisticElement& elem1,const LinguisticElement& elem2) const
33{
34 return m_prop.readValue(elem1.properties) < m_prop.readValue(elem2.properties);
35}
36
40
42{
43 if (elem1.normalizedForm!=elem2.normalizedForm) return elem1.normalizedForm < elem2.normalizedForm;
44 return m_prop.readValue(elem1.properties) < m_prop.readValue(elem2.properties);
45}
46
51
53{
54 return m_property.equal(elem.properties,m_value);
55}
56
63
65{
66 return !(m_property.equal(elem.properties,m_value));
67}
68
71 const std::set<LinguisticCode>& values) :
72 m_property(prop),
73 m_values(values)
74{}
75
77{
78 return (m_values.find(m_property.readValue(elem.properties)) != m_values.end());
79}
80
83 const std::set<LinguisticCode>& values) :
84 m_property(prop),
85 m_values(values)
86{
87}
88
90 m_property(epp.m_property),
91 m_values(epp.m_values)
92{
93}
94
96{
97 return (m_values.find(m_property.readValue(elem.properties)) == m_values.end());
98}
99
100} // LinguisticAnalysisStructure
101
102} // LinguisticProcessing
103
104} // Lima
Provide function to read write and check a property.
bool equal(const LinguisticCode &l1, const LinguisticCode &l2) const
check property equality for two linguisticCode
LinguisticCode readValue(const LinguisticCode &code) const
read a property in a coded int.
CheckDifferentPropertyPredicate(const Common::PropertyCode::PropertyAccessor &prop, LinguisticCode value)
CheckEqualPropertyPredicate(const Common::PropertyCode::PropertyAccessor &prop, LinguisticCode value)
ExcludePropertyPredicate(const Common::PropertyCode::PropertyAccessor &prop, const std::set< LinguisticCode > &value)
IncludePropertyPredicate(const Common::PropertyCode::PropertyAccessor &prop, const std::set< LinguisticCode > &value)
bool operator()(const LinguisticElement &elem1, const LinguisticElement &elem2) const
bool operator()(const LinguisticElement &elem1, const LinguisticElement &elem2) const
bool operator()(const LinguisticElement &elem1, const LinguisticElement &elem2) const
NAUTITIA.