LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
Lima::Common::PropertyCode::PropertyCodeManager Class Reference

Provide tools to parse a property file, and deal with the property coding system. More...

#include <linguisticProcessing/common/PropertyCode/PropertyCodeManager.h>

Public Member Functions

 PropertyCodeManager ()
 Default Constructor.
 
 ~PropertyCodeManager ()
 
 PropertyCodeManager (const PropertyCodeManager &)
 
PropertyCodeManager & operator= (const PropertyCodeManager &)
 
void readFromXmlFile (const std::string &filename)
 This functions should be called once, just after creation.
 
const PropertyAccessor & getPropertyAccessor (const std::string &propertyName) const
 Get the PropertyAccessor associated to a property.
 
const PropertyManager & getPropertyManager (const std::string &propertyName) const
 Get the PropertyManager associated to a property.
 
const std::shared_ptr< PropertyAccessor > getPropertySetAccessor (const std::set< std::string > &propertyNames) const
 Get a PropertyAccessor associated to several properties.
 
const std::map< std::string, PropertyManager > & getPropertyManagers () const
 Get the map of all PropertyManagers.
 
LinguisticCode encode (const std::map< std::string, std::string > &propValues) const
 Compute the code corresponding to given the properties/values.
 
void convertSymbolicCodes (const std::string &symbolicCodeFile, std::map< std::string, LinguisticCode > &conversionTable) const
 Compute conversion of symbolic codes into linguisticCode and append them into the given map.
 

Friends

class PropertyCodeManagerPrivate
 

Detailed Description

Provide tools to parse a property file, and deal with the property coding system.

Main Entry Point for property coding, Holds data about a property coding system.

Author
Benoit Mathieu

Definition at line 33 of file PropertyCodeManager.h.

Constructor & Destructor Documentation

◆ PropertyCodeManager() [1/2]

Lima::Common::PropertyCode::PropertyCodeManager::PropertyCodeManager ( )

Default Constructor.

Returns

Definition at line 81 of file PropertyCodeManager.cpp.

◆ ~PropertyCodeManager()

Lima::Common::PropertyCode::PropertyCodeManager::~PropertyCodeManager ( )

Definition at line 86 of file PropertyCodeManager.cpp.

◆ PropertyCodeManager() [2/2]

Lima::Common::PropertyCode::PropertyCodeManager::PropertyCodeManager ( const PropertyCodeManager &  pcm)

Definition at line 90 of file PropertyCodeManager.cpp.

Member Function Documentation

◆ convertSymbolicCodes()

void Lima::Common::PropertyCode::PropertyCodeManager::convertSymbolicCodes ( const std::string &  symbolicCodeFile,
std::map< std::string, LinguisticCode > &  conversionTable 
) const

Compute conversion of symbolic codes into linguisticCode and append them into the given map.

The given is an xml file : <codes> <code key="Ncgms-"> <field key="MICRO" value="NC"/> <field key="GENDER" value="MASC"/> <field key="NUMBER" value="SING"/> <field key="PERSON" value=""/> <field key="TIME" value=""/> <field key="SYNTAX" value=""/> </code> ... </codes>

Parameters
symbolicCodeFileName of the file to convert
conversionTableMap to which append the results

Definition at line 380 of file PropertyCodeManager.cpp.

◆ encode()

LinguisticCode Lima::Common::PropertyCode::PropertyCodeManager::encode ( const std::map< std::string, std::string > &  propValues) const

Compute the code corresponding to given the properties/values.

Warning : No consistency check. If the given map contains a subproperty value and a incoherent parent property value, only the last will be kept.

Encode properties

Parameters
propValuesmapping (property name -> property value) to encode
Returns
coded LinguisticCode

Definition at line 359 of file PropertyCodeManager.cpp.

◆ getPropertyAccessor()

const PropertyAccessor & Lima::Common::PropertyCode::PropertyCodeManager::getPropertyAccessor ( const std::string &  propertyName) const

Get the PropertyAccessor associated to a property.

Parameters
propertyNameName of the property
Returns
PropertyAccessor

Definition at line 421 of file PropertyCodeManager.cpp.

◆ getPropertyManager()

const PropertyManager & Lima::Common::PropertyCode::PropertyCodeManager::getPropertyManager ( const std::string &  propertyName) const

Get the PropertyManager associated to a property.

Parameters
propertyNameName of the property
Returns
PropertyManager

Definition at line 276 of file PropertyCodeManager.cpp.

◆ getPropertyManagers()

const std::map< std::string, PropertyManager > & Lima::Common::PropertyCode::PropertyCodeManager::getPropertyManagers ( ) const

Get the map of all PropertyManagers.

Returns
A map from propery names to associated PropertyManager

Definition at line 416 of file PropertyCodeManager.cpp.

◆ getPropertySetAccessor()

const std::shared_ptr< PropertyAccessor > Lima::Common::PropertyCode::PropertyCodeManager::getPropertySetAccessor ( const std::set< std::string > &  propertyNames) const

Get a PropertyAccessor associated to several properties.

Parameters
propertyNameName of the property
Returns
PropertyAccessor

Definition at line 289 of file PropertyCodeManager.cpp.

◆ operator=()

PropertyCodeManager & Lima::Common::PropertyCode::PropertyCodeManager::operator= ( const PropertyCodeManager &  pcm)

Definition at line 96 of file PropertyCodeManager.cpp.

◆ readFromXmlFile()

void Lima::Common::PropertyCode::PropertyCodeManager::readFromXmlFile ( const std::string &  filename)

This functions should be called once, just after creation.

It computes all data necessary to perform coding/decoding operations

Parse coding data from an XML file.

Parameters
filenamename of the XML file to parse

Definition at line 102 of file PropertyCodeManager.cpp.

Friends And Related Symbol Documentation

◆ PropertyCodeManagerPrivate

friend class PropertyCodeManagerPrivate
friend

Definition at line 35 of file PropertyCodeManager.h.


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