LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
NormalizePerson.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 NormalizePerson.h
9
* @author Olivier Mesnarrd (olivier.mesnard@cea.fr)
10
* @date Wed Jan 13 2015
11
* copyright Copyright (C) 2006-2015 by CEA LIST
12
* Project lima_linguisticprocessing
13
*
14
* @brief action for the normalization of person (replace normalization of person name)
15
*
16
*
17
***********************************************************************/
18
19
#ifndef NORMALIZEPERSON_H
20
#define NORMALIZEPERSON_H
21
22
#include "
SpecificEntitiesExport.h
"
23
#include "
linguisticProcessing/core/Automaton/constraintFunction.h
"
24
25
namespace
Lima
{
26
namespace
LinguisticProcessing {
27
namespace
SpecificEntities {
28
29
//**********************************************************************
30
// ids of actions defined in this file
31
#define NormalizePersonId "NormalizePerson"
32
33
class
LIMA_SPECIFICENTITIES_PERSON_EXPORT
NormalizePerson
:
public
Automaton::ConstraintFunction
34
{
35
public
:
36
NormalizePerson
(MediaId language,
37
const
LimaString
& complement=
LimaString
());
38
~NormalizePerson
() {}
39
40
// function to normalize person names specifying firstname and lastname
41
/* bool operator()(const LinguisticAnalysisStructure::AnalysisGraph& graph, */
42
/* const LinguisticGraphVertex& v1, */
43
/* const LinguisticGraphVertex& v2, */
44
/* AnalysisContent& analysis) const; */
45
46
// function to normalize person names using a simple heuristic on result
47
// to separate firstname from lastname
48
bool
operator()(
Automaton::RecognizerMatch
& m,
49
AnalysisContent
& analysis)
const override
;
50
51
bool
actionNeedsRecognizedExpression
()
override
{
return
true
; }
52
53
private
:
54
MediaId m_language;
55
LimaString
m_firstname;
// values of firstname and lastname
56
LimaString
m_lastname;
// possibly given as arguments of the action
57
const
std::set<LinguisticCode>* m_microsForFirstname;
58
const
Common::PropertyCode::PropertyAccessor
* m_microAccessor;
59
};
60
61
}
// end namespace
62
}
// end namespace
63
}
// end namespace
64
65
#endif
SpecificEntitiesExport.h
LIMA_SPECIFICENTITIES_PERSON_EXPORT
#define LIMA_SPECIFICENTITIES_PERSON_EXPORT
Definition
SpecificEntitiesExport.h:50
Lima::AnalysisContent
Holds all data that pass through the ProcessUnits Analysis data are shared pointers,...
Definition
AnalysisContent.h:37
Lima::Common::PropertyCode::PropertyAccessor
Provide function to read write and check a property.
Definition
PropertyAccessor.h:31
Lima::LinguisticProcessing::Automaton::ConstraintFunction
Definition
constraintFunction.h:37
Lima::LinguisticProcessing::Automaton::RecognizerMatch
Definition
recognizerMatch.h:56
Lima::LinguisticProcessing::SpecificEntities::NormalizePerson
Definition
NormalizePerson.h:34
Lima::LinguisticProcessing::SpecificEntities::NormalizePerson::~NormalizePerson
~NormalizePerson()
Definition
NormalizePerson.h:38
Lima::LinguisticProcessing::SpecificEntities::NormalizePerson::actionNeedsRecognizedExpression
bool actionNeedsRecognizedExpression() override
Definition
NormalizePerson.h:51
constraintFunction.h
Lima
NAUTITIA.
Definition
AmosePluginsManager.h:15
Lima::LimaString
QString LimaString
Definition
LimaString.h:33
lima_linguisticprocessing
src
linguisticProcessing
core
SpecificEntities
NormalizePerson.h
Generated by
1.9.8