LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
CompoundTokenAnnotation.h
Go to the documentation of this file.
1// Copyright 2002-2022 CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
6#ifndef LIMA_LINGUISTICPROCESSING_COMPOUNDS_COMPOUNDTOKENANNOTATION_H
7#define LIMA_LINGUISTICPROCESSING_COMPOUNDS_COMPOUNDTOKENANNOTATION_H
8
9#include "CompoundsExport.h"
13
14
15#include <vector>
16
17#ifdef WIN32
18#undef min
19#undef max
20#endif
21namespace Lima
22{
23
24namespace LinguisticProcessing
25{
26
27namespace Compounds
28{
29
34//enum SemanticTypes {
35// Determiner, /**< Used for determiners as articles, pronouns, etc. */
36// SemanticModifier, /**< Used for modifiers as adverbs */
37// Complementer /**< Used for complementers like noun complements or adjectives */
38//};
39
47{
48public:
49
51 ConceptModifier(const StringsPoolIndex& realization,
52 const Common::MediaticData::ConceptType type
53 = Common::MediaticData::ConceptType(std::numeric_limits< uint32_t >::max()),
54 const std::vector< uint64_t >& references
55 = std::vector< uint64_t>());
56
57 virtual ~ConceptModifier();
58
59
61 void dump(std::ostream& os,const FsaStringsPool& sp) const;
62
63 inline StringsPoolIndex getRealization() const;
64// inline void setRealization(StringsPoolIndex realization);
65 inline Common::MediaticData::ConceptType getConceptType() const;
66 inline void setConceptType(Common::MediaticData::ConceptType type);
67 inline const std::vector< uint64_t >& getReferencedAnnotations() const;
68 std::vector< uint64_t >& getReferencedAnnotations();
69 inline void setReferencedAnnotations(const std::vector< uint64_t >& references);
70 inline int32_t getIntensity() const;
71 inline void setIntensity(int32_t intensity);
72
73private:
74 StringsPoolIndex m_realization;
76 Common::MediaticData::ConceptType m_conceptType;
82 std::vector< uint64_t> m_referencedAnnotations;
88 int32_t m_intensity;
95};
96
97
98class LIMA_COMPOUNDS_EXPORT CompoundTokenAnnotation : public std::vector< ConceptModifier >
99{
100public:
103
105 void dump(std::ostream& os,const FsaStringsPool& sp);
106};
107
118public:
119
121
122 virtual int dump(
123 std::ostream& os,
125
126private:
127 const FsaStringsPool& m_sp;
128};
129
130
131inline StringsPoolIndex ConceptModifier::getRealization() const
132{
133 return m_realization;
134}
135
136// inline void ConceptModifier::setRealization(StringsPoolIndex realization)
137// {
138// m_realization = realization;
139// }
140
141inline Common::MediaticData::ConceptType ConceptModifier::getConceptType() const
142{
143 return m_conceptType;
144}
145
146inline void ConceptModifier::setConceptType(Common::MediaticData::ConceptType type)
147{
148 m_conceptType = type;
149}
150
151inline const std::vector< uint64_t >& ConceptModifier::getReferencedAnnotations() const
152{
153 return m_referencedAnnotations;
154}
155
156inline std::vector< uint64_t >& ConceptModifier::getReferencedAnnotations()
157{
158 return m_referencedAnnotations;
159}
160
161inline void ConceptModifier::setReferencedAnnotations(const std::vector< uint64_t >& references)
162{
163 m_referencedAnnotations = references;
164}
165
166inline int32_t ConceptModifier::getIntensity() const
167{
168 return m_intensity;
169}
170
171inline void ConceptModifier::setIntensity(int32_t intensity)
172{
173 m_intensity = intensity;
174}
175
176} // Compounds
177} // LinguisticProcessing
178} // Lima
179
180#endif
181
This file is the main header file for the data related to annotation graphs.
#define LIMA_COMPOUNDS_EXPORT
This class allows to convert any object into an annotation by inheritance.
This enumeration lists the types of annotations used to specify the role of an annotation in a compou...
const std::vector< uint64_t > & getReferencedAnnotations() const
void setConceptType(Common::MediaticData::ConceptType type)
void setReferencedAnnotations(const std::vector< uint64_t > &references)
Common::MediaticData::ConceptType getConceptType() const
Definition of a function suitable to be used as a dumper for a compound token annotation of an annota...
NAUTITIA.