LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
Entity.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 * @file Entity.h
8 * @author Faiza GARA
9 * @date October 2007
10 * @version
11 * copyright Copyright (C) 2007 by CEA LIST
12 *
13 * @brief
14 *
15 ***********************************************************************/
16
17#ifndef ENTITY_H
18#define ENTITY_H
19
20#include "EventAnalysisExport.h"
22
23
24namespace Lima {
25namespace LinguisticProcessing {
26namespace EventAnalysis {
27
28
30{
31public:
32
33 Entity(const uint64_t position,
34 const uint64_t length,
36 Entity();
37
38
39 uint64_t getPosition(void) const {return m_position;};
40 uint64_t getLength(void) const {return m_length;};
41 uint64_t getStart(){return m_position;}
42 uint64_t getEnd(){return (m_position+m_length-1);}
43 bool getMain(void) const {return m_main;};
45
46 std::map<std::string,std::string> getMapFeatures(void) const;
47
48 void setPosition(uint64_t position){m_position=position;}
49 void setLength(uint64_t length){m_length=length;}
51 void setMain(bool main) {m_main=main;}
52
53
54 virtual ~Entity();
55
56 virtual void clear() {};
57
58 virtual Entity* clone() const;
59
60
62 virtual std::string getOutputUTF8String(void) const;
63
65 virtual std::string getIdUTF8String() const;
66
68 virtual std::string toString(std::string parentURI) const;
69
71 virtual void read(std::istream& file);
72 virtual void write(std::ostream& file) const;
73
74
75 LIMA_EVENTANALISYS_EXPORT friend std::ostream& operator << (std::ostream&, const Entity&);
76
77
78
82 bool operator==(const Entity&) const;
83
88 bool operator!=(const Entity&) const;
89
90
91
92 protected:
93
94 uint64_t m_position;
95 uint64_t m_length;
96 bool m_main;
98
99
100};
101
102
103inline Entity* Entity::clone() const
104{
105 return new Entity(*this);
106}
107
108
109
110} // namespace EventAnalysis
111} // namespace LinguisticProcessing
112} // namespace Lima
113
114#endif
#define LIMA_EVENTANALISYS_EXPORT
QDebug & operator<<(QDebug &qd, const std::string &str)
Definition QsLog.cpp:39
a list of generic features: each feature is unique (only one feature for a name)
void setFeatures(Lima::LinguisticProcessing::Automaton::EntityFeatures features)
Definition Entity.h:50
Lima::LinguisticProcessing::Automaton::EntityFeatures getFeatures(void) const
Definition Entity.h:44
Lima::LinguisticProcessing::Automaton::EntityFeatures m_features
Definition Entity.h:97
int main(int argc, char *argv[])
Definition main.cpp:14
NAUTITIA.