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

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

Inheritance diagram for Lima::LinguisticProcessing::SpecificEntities::NormalizeDate:
Lima::LinguisticProcessing::Automaton::ConstraintFunction Lima::LinguisticProcessing::SpecificEntities::NormalizeRelativeDate

Public Member Functions

 NormalizeDate (MediaId language, const LimaString &complement=LimaString())
 
 ~NormalizeDate ()
 
bool operator() (Automaton::RecognizerMatch &m, AnalysisContent &analysis) const override
 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: uses the result of the match
 
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 ()
 

Protected Member Functions

void updateCurrentDate (AnalysisContent &analysis, const QDate &currentDate) const
 
unsigned short getDayFromString (const LimaString &numdayString) const
 
unsigned short getDay (Automaton::RecognizerMatch &m, const std::string &featureName) const
 
unsigned short getWeekDay (Automaton::RecognizerMatch &m, const std::string &featureName) const
 
unsigned short getMonth (Automaton::RecognizerMatch &m, const std::string &featureName, const std::string &alt="") const
 
unsigned short getYear (Automaton::RecognizerMatch &m, const std::string &featureName) const
 
unsigned short getDefaultYear (AnalysisContent &analysis) const
 
QString getDateSpan (unsigned short year, unsigned short month, unsigned short day) const
 
- Protected Member Functions inherited from Lima::LinguisticProcessing::Automaton::ConstraintFunction
 ConstraintFunction (MediaId language, const LimaString &complement=LimaString())
 

Protected Attributes

MediaId m_language
 
std::shared_ptr< NormalizeDateTimeResources > m_resources
 
ReferenceData m_referenceData
 
const std::set< LinguisticCode > * m_microsForMonth
 
const std::set< LinguisticCode > * m_microsForDays
 
const Common::PropertyCode::PropertyAccessor * m_microAccessor
 
bool m_isInterval
 
- Protected Attributes inherited from Lima::LinguisticProcessing::Automaton::ConstraintFunction
MediaId m_language_id
 
LimaString m_complement
 

Detailed Description

Definition at line 66 of file NormalizeDateTime.h.

Constructor & Destructor Documentation

◆ NormalizeDate()

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

Definition at line 212 of file NormalizeDateTime.cpp.

◆ ~NormalizeDate()

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

Definition at line 71 of file NormalizeDateTime.h.

Member Function Documentation

◆ actionNeedsRecognizedExpression()

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

◆ getDateSpan()

QString Lima::LinguisticProcessing::SpecificEntities::NormalizeDate::getDateSpan ( unsigned short  year,
unsigned short  month,
unsigned short  day 
) const
protected

Definition at line 384 of file NormalizeDateTime.cpp.

◆ getDay()

unsigned short Lima::LinguisticProcessing::SpecificEntities::NormalizeDate::getDay ( Automaton::RecognizerMatch &  m,
const std::string &  featureName 
) const
protected

Definition at line 311 of file NormalizeDateTime.cpp.

◆ getDayFromString()

unsigned short Lima::LinguisticProcessing::SpecificEntities::NormalizeDate::getDayFromString ( const LimaString &  numdayString) const
protected

Definition at line 280 of file NormalizeDateTime.cpp.

◆ getDefaultYear()

unsigned short Lima::LinguisticProcessing::SpecificEntities::NormalizeDate::getDefaultYear ( AnalysisContent &  analysis) const
protected

◆ getMonth()

unsigned short Lima::LinguisticProcessing::SpecificEntities::NormalizeDate::getMonth ( Automaton::RecognizerMatch &  m,
const std::string &  featureName,
const std::string &  alt = "" 
) const
protected

Definition at line 340 of file NormalizeDateTime.cpp.

◆ getWeekDay()

unsigned short Lima::LinguisticProcessing::SpecificEntities::NormalizeDate::getWeekDay ( Automaton::RecognizerMatch &  m,
const std::string &  featureName 
) const
protected

Definition at line 330 of file NormalizeDateTime.cpp.

◆ getYear()

unsigned short Lima::LinguisticProcessing::SpecificEntities::NormalizeDate::getYear ( Automaton::RecognizerMatch &  m,
const std::string &  featureName 
) const
protected

Definition at line 359 of file NormalizeDateTime.cpp.

◆ operator()()

bool Lima::LinguisticProcessing::SpecificEntities::NormalizeDate::operator() ( Automaton::RecognizerMatch &  ,
AnalysisContent &   
) const
overridevirtual

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: uses the result of the match

Returns
true if the action of the function succeeded, false otherwise

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

Reimplemented in Lima::LinguisticProcessing::SpecificEntities::NormalizeRelativeDate.

Definition at line 413 of file NormalizeDateTime.cpp.

◆ updateCurrentDate()

void Lima::LinguisticProcessing::SpecificEntities::NormalizeDate::updateCurrentDate ( AnalysisContent &  analysis,
const QDate &  currentDate 
) const
protected

Definition at line 264 of file NormalizeDateTime.cpp.

Member Data Documentation

◆ m_isInterval

bool Lima::LinguisticProcessing::SpecificEntities::NormalizeDate::m_isInterval
protected

Definition at line 85 of file NormalizeDateTime.h.

◆ m_language

MediaId Lima::LinguisticProcessing::SpecificEntities::NormalizeDate::m_language
protected

Definition at line 79 of file NormalizeDateTime.h.

◆ m_microAccessor

const Common::PropertyCode::PropertyAccessor* Lima::LinguisticProcessing::SpecificEntities::NormalizeDate::m_microAccessor
protected

Definition at line 84 of file NormalizeDateTime.h.

◆ m_microsForDays

const std::set<LinguisticCode>* Lima::LinguisticProcessing::SpecificEntities::NormalizeDate::m_microsForDays
protected

Definition at line 83 of file NormalizeDateTime.h.

◆ m_microsForMonth

const std::set<LinguisticCode>* Lima::LinguisticProcessing::SpecificEntities::NormalizeDate::m_microsForMonth
protected

Definition at line 82 of file NormalizeDateTime.h.

◆ m_referenceData

ReferenceData Lima::LinguisticProcessing::SpecificEntities::NormalizeDate::m_referenceData
protected

Definition at line 81 of file NormalizeDateTime.h.

◆ m_resources

std::shared_ptr<NormalizeDateTimeResources> Lima::LinguisticProcessing::SpecificEntities::NormalizeDate::m_resources
protected

Definition at line 80 of file NormalizeDateTime.h.


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