LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
EntityType.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 entityType.h
9
* @author Romaric Besancon (romaric.besancon@cea.fr)
10
* @date Mon Jan 22 2007
11
* copyright Copyright (C) 2007-2012 by CEA LIST
12
* Project InformationExtraction
13
*
14
* @brief
15
*
16
*
17
***********************************************************************/
18
19
#ifndef ENTITYTYPE_H
20
#define ENTITYTYPE_H
21
22
#include "
common/LimaCommon.h
"
23
24
#include <iostream>
25
#include <map>
26
27
#include <boost/serialization/strong_typedef.hpp>
28
29
namespace
Lima
{
30
namespace
Common {
31
namespace
MediaticData {
32
33
BOOST_STRONG_TYPEDEF
(
unsigned
short
, EntityTypeId);
34
BOOST_STRONG_TYPEDEF
(
unsigned
short
, EntityGroupId);
35
36
class
EntityTypePrivate
;
37
class
LIMA_MEDIATICDATA_EXPORT
EntityType
38
{
39
public
:
40
EntityType
();
41
EntityType
(EntityTypeId
id
, EntityGroupId groupId);
42
EntityType
& operator=(
const
EntityType
& et);
43
EntityType
(
const
EntityType
& et);
44
~EntityType
();
45
46
bool
operator==(
const
EntityType
& other)
const
;
47
bool
operator!=(
const
EntityType
& other)
const
;
48
bool
operator<
(
const
EntityType
& other)
const
;
49
50
bool
isNull()
const
;
51
52
EntityTypeId getTypeId()
const
;
53
EntityGroupId getGroupId()
const
;
54
55
void
setTypeId(EntityTypeId
id
);
56
void
setGroupId(EntityGroupId groupId);
57
58
friend
LIMA_MEDIATICDATA_EXPORT
QTextStream&
operator <<
(QTextStream&,
const
EntityType
&);
59
friend
LIMA_MEDIATICDATA_EXPORT
std::ostream&
operator <<
(std::ostream&,
const
EntityType
&);
60
friend
LIMA_MEDIATICDATA_EXPORT
QDebug&
operator <<
(QDebug&,
const
EntityType
&);
61
62
private
:
63
EntityTypePrivate
* m_d;
64
};
65
66
// hierarchy of entity types
67
class
EntityTypeHierarchyPrivate
;
68
class
LIMA_MEDIATICDATA_EXPORT
EntityTypeHierarchy
69
{
70
public
:
71
EntityTypeHierarchy
();
72
~EntityTypeHierarchy
();
73
74
void
addParentLink(
const
EntityType
& child,
const
EntityType
& parent);
75
bool
isParent(
const
EntityType
& child,
const
EntityType
& parent)
const
;
76
bool
isAncestor(
const
EntityType
& child,
const
EntityType
& parent)
const
;
77
// get highest ancestor in the hierarchy (return child itself if has no parent)
78
EntityType
getAncestor(
const
EntityType
& child)
const
;
79
// get first ancestor in the hierarchy (return child itself if has no parent)
80
EntityType
getParent(
const
EntityType
& child)
const
;
81
// get the list of nodes under the given ancestor as a map of child-firstParent tuples
82
bool
getChildren(
const
EntityType
& ancestor, std::map<EntityType,EntityType>& childList)
const
;
83
84
private
:
85
EntityTypeHierarchyPrivate
* m_d;
86
};
87
88
}
// end namespace
89
}
// end namespace
90
}
// end namespace
91
92
#endif
LimaCommon.h
operator<<
QDebug & operator<<(QDebug &qd, const std::string &str)
Definition
QsLog.cpp:39
LIMA_MEDIATICDATA_EXPORT
#define LIMA_MEDIATICDATA_EXPORT
Definition
LimaCommon.h:132
Lima::Common::MediaticData::EntityTypeHierarchyPrivate
Definition
EntityType.cpp:164
Lima::Common::MediaticData::EntityTypeHierarchy
Definition
EntityType.h:69
Lima::Common::MediaticData::EntityTypePrivate
Definition
EntityType.cpp:21
Lima::Common::MediaticData::EntityType
Definition
EntityType.h:38
Lima::Common::MediaticData::BOOST_STRONG_TYPEDEF
BOOST_STRONG_TYPEDEF(unsigned short, EntityTypeId)
Lima
NAUTITIA.
Definition
AmosePluginsManager.h:15
operator<
static bool operator<(const QStringView &entityStr, const TextHtmlEntity &entity)
Definition
qtSgmlEntities.cpp:307
lima_common
src
common
MediaticData
EntityType.h
Generated by
1.9.8