LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
Lima::LinguisticProcessing::SpecificEntities::NormalizePersonName Class Reference

#include <linguisticProcessing/core/SpecificEntities/NormalizePersonName.h>

Inheritance diagram for Lima::LinguisticProcessing::SpecificEntities::NormalizePersonName:
Lima::LinguisticProcessing::Automaton::ConstraintFunction

Public Member Functions

 NormalizePersonName (MediaId language, const LimaString &complement=LimaString())
 
 ~NormalizePersonName ()
 
bool operator() (Automaton::RecognizerMatch &m, AnalysisContent &analysis) const override
 compute the normalized form of a person name heuristic :
 
bool actionNeedsRecognizedExpression () override
 
- Public Member Functions inherited from Lima::LinguisticProcessing::Automaton::ConstraintFunction
virtual ~ConstraintFunction ()
 
virtual bool operator() (const LinguisticAnalysisStructure::AnalysisGraph &, const LinguisticGraphVertex &, const LinguisticGraphVertex &, AnalysisContent &) const
 binary constraint function : the constraint only applies on two vertices in the graph (the graph is also given as a parameter).
 
virtual bool operator() (const LinguisticAnalysisStructure::AnalysisGraph &, const LinguisticGraphVertex &, AnalysisContent &) const
 unary constraint function : the constraint only applies on one vertices in the graph (the graph is also given as a parameter).
 
virtual bool operator() (AnalysisContent &) const
 zero-ary constraint function : applies the function without a vertex indication (used for actions, not constraints -> applied only at end, when a match is found)
 
const LimaString & getComplementString ()
 
unsigned char getLanguage ()
 

Additional Inherited Members

- Protected Member Functions inherited from Lima::LinguisticProcessing::Automaton::ConstraintFunction
 ConstraintFunction (MediaId language, const LimaString &complement=LimaString())
 
- Protected Attributes inherited from Lima::LinguisticProcessing::Automaton::ConstraintFunction
MediaId m_language_id
 
LimaString m_complement
 

Detailed Description

Definition at line 33 of file NormalizePersonName.h.

Constructor & Destructor Documentation

◆ NormalizePersonName()

Lima::LinguisticProcessing::SpecificEntities::NormalizePersonName::NormalizePersonName ( MediaId  language,
const LimaString &  complement = LimaString() 
)

Definition at line 65 of file NormalizePersonName.cpp.

◆ ~NormalizePersonName()

Lima::LinguisticProcessing::SpecificEntities::NormalizePersonName::~NormalizePersonName ( )
inline

Definition at line 38 of file NormalizePersonName.h.

Member Function Documentation

◆ actionNeedsRecognizedExpression()

bool Lima::LinguisticProcessing::SpecificEntities::NormalizePersonName::actionNeedsRecognizedExpression ( )
inlineoverridevirtual

◆ operator()()

bool Lima::LinguisticProcessing::SpecificEntities::NormalizePersonName::operator() ( Automaton::RecognizerMatch &  m,
AnalysisContent &  analysis 
) const
overridevirtual

compute the normalized form of a person name heuristic :

  • if one or several elements of the entity are identified as firstnames in the dictionary => set them as firstname, set the other elements as lastname
  • if no elements are identified as firstnames in the dictionary : if there are only one element : set it as lastname if there are only two elements: set first as firstname, second as lastname

    if there is an initial : set whatever is before the initial + the initial as firstname, whatever is after as lastname (this one is not applied for the moment)

Parameters
mthe match for the person name to normalize

Reimplemented from Lima::LinguisticProcessing::Automaton::ConstraintFunction.

Definition at line 121 of file NormalizePersonName.cpp.


The documentation for this class was generated from the following files: