LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
EventTemplateStructure.cpp
Go to the documentation of this file.
1// Copyright (C) 2011 by CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
10
11namespace Lima {
12 using namespace Common;
13namespace LinguisticProcessing {
14namespace EventAnalysis {
15
17m_name(),
18m_structure()
19{
20}
21
24
25void EventTemplateStructure::addTemplateElement(const std::string& role,
26 const std::string entityType)
27{
28 if (m_structure.find(role)!=m_structure.end()) {
30 LERROR << "In event " << m_name << ", element '"<< role
31 <<"' is defined twice";
32 }
33 else {
34 try {
35 auto type = MediaticData::MediaticData::single().getEntityType(
36 QString::fromUtf8(entityType.c_str()));
37 m_structure[role]=type;
38 }
39 catch (LimaException& e) {
41 LERROR << "EventTemplateStructure: failed to resolve entity type" << entityType << ": ignore role" << role;
42 }
43 }
44}
45
46
47
48} // end namespace
49} // end namespace
50} // end namespace
#define LERROR
Definition LimaCommon.h:161
#define EVENTANALYSISLOGINIT
The main LIMA exception class.
Definition LimaCommon.h:262
void addTemplateElement(const std::string &role, const std::string entityType)
NAUTITIA.