![]() |
LIMA
Libre Multilingual Analyzer — C++ API
|
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 |
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.
Definition at line 33 of file PropertyCodeManager.h.
| Lima::Common::PropertyCode::PropertyCodeManager::PropertyCodeManager | ( | ) |
| Lima::Common::PropertyCode::PropertyCodeManager::~PropertyCodeManager | ( | ) |
Definition at line 86 of file PropertyCodeManager.cpp.
| Lima::Common::PropertyCode::PropertyCodeManager::PropertyCodeManager | ( | const PropertyCodeManager & | pcm | ) |
Definition at line 90 of file PropertyCodeManager.cpp.
| 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>
| symbolicCodeFile | Name of the file to convert |
| conversionTable | Map to which append the results |
Definition at line 380 of file PropertyCodeManager.cpp.
| 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
| propValues | mapping (property name -> property value) to encode |
Definition at line 359 of file PropertyCodeManager.cpp.
| const PropertyAccessor & Lima::Common::PropertyCode::PropertyCodeManager::getPropertyAccessor | ( | const std::string & | propertyName | ) | const |
Get the PropertyAccessor associated to a property.
| propertyName | Name of the property |
Definition at line 421 of file PropertyCodeManager.cpp.
| const PropertyManager & Lima::Common::PropertyCode::PropertyCodeManager::getPropertyManager | ( | const std::string & | propertyName | ) | const |
Get the PropertyManager associated to a property.
| propertyName | Name of the property |
Definition at line 276 of file PropertyCodeManager.cpp.
| const std::map< std::string, PropertyManager > & Lima::Common::PropertyCode::PropertyCodeManager::getPropertyManagers | ( | ) | const |
Get the map of all PropertyManagers.
Definition at line 416 of file PropertyCodeManager.cpp.
| const std::shared_ptr< PropertyAccessor > Lima::Common::PropertyCode::PropertyCodeManager::getPropertySetAccessor | ( | const std::set< std::string > & | propertyNames | ) | const |
Get a PropertyAccessor associated to several properties.
| propertyName | Name of the property |
Definition at line 289 of file PropertyCodeManager.cpp.
| PropertyCodeManager & Lima::Common::PropertyCode::PropertyCodeManager::operator= | ( | const PropertyCodeManager & | pcm | ) |
Definition at line 96 of file PropertyCodeManager.cpp.
| 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.
| filename | name of the XML file to parse |
Definition at line 102 of file PropertyCodeManager.cpp.
|
friend |
Definition at line 35 of file PropertyCodeManager.h.