2013-10-24 17:08:58 +02:00
|
|
|
#ifndef CONCORDIA_CONFIG_HDR
|
|
|
|
#define CONCORDIA_CONFIG_HDR
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <list>
|
|
|
|
#include <libconfig.h++>
|
|
|
|
|
|
|
|
#include "concordia/concordia_exception.hpp"
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Class representing the Concordia configuration.
|
|
|
|
*/
|
|
|
|
class ConcordiaConfig {
|
|
|
|
public:
|
|
|
|
/*!
|
|
|
|
Constructor.
|
|
|
|
\param configFilePath path of the configuration file (see \ref running3 for file specification).
|
|
|
|
\throws ConcordiaException
|
|
|
|
*/
|
2015-04-15 14:14:10 +02:00
|
|
|
explicit ConcordiaConfig(const std::string & configFilePath)
|
|
|
|
throw(ConcordiaException);
|
2013-10-24 17:08:58 +02:00
|
|
|
|
|
|
|
/*! Destructor.
|
|
|
|
*/
|
|
|
|
virtual ~ConcordiaConfig();
|
|
|
|
|
2015-04-15 14:14:10 +02:00
|
|
|
std::string & getWordMapFilePath() {
|
2013-11-28 16:47:57 +01:00
|
|
|
return _wordMapFilePath;
|
|
|
|
}
|
|
|
|
|
2015-04-15 14:14:10 +02:00
|
|
|
std::string & getHashedIndexFilePath() {
|
2013-11-28 16:47:57 +01:00
|
|
|
return _hashedIndexFilePath;
|
|
|
|
}
|
|
|
|
|
2015-04-15 14:14:10 +02:00
|
|
|
std::string & getMarkersFilePath() {
|
2014-02-20 10:49:17 +01:00
|
|
|
return _markersFilePath;
|
|
|
|
}
|
|
|
|
|
2015-04-15 14:14:10 +02:00
|
|
|
std::string & getHtmlTagsFilePath() {
|
2014-04-29 14:46:04 +02:00
|
|
|
return _htmlTagsFilePath;
|
|
|
|
}
|
|
|
|
|
2015-04-15 14:14:10 +02:00
|
|
|
std::string & getSpaceSymbolsFilePath() {
|
2014-04-29 14:46:04 +02:00
|
|
|
return _spaceSymbolsFilePath;
|
|
|
|
}
|
|
|
|
|
2015-04-21 21:33:08 +02:00
|
|
|
bool & isStopWordsEnabled() {
|
|
|
|
return _stopWordsEnabled;
|
|
|
|
}
|
|
|
|
|
2015-04-15 14:14:10 +02:00
|
|
|
std::string & getStopWordsFilePath() {
|
2014-04-29 14:46:04 +02:00
|
|
|
return _stopWordsFilePath;
|
|
|
|
}
|
|
|
|
|
2015-04-15 14:14:10 +02:00
|
|
|
std::string & getNamedEntitiesFilePath() {
|
2014-04-29 14:46:04 +02:00
|
|
|
return _namedEntitiesFilePath;
|
|
|
|
}
|
|
|
|
|
2015-04-15 14:14:10 +02:00
|
|
|
std::string & getStopSymbolsFilePath() {
|
2014-04-29 14:46:04 +02:00
|
|
|
return _stopSymbolsFilePath;
|
|
|
|
}
|
|
|
|
|
2015-04-16 11:39:39 +02:00
|
|
|
double getAnubisThreshold() {
|
|
|
|
return _anubisThreshold;
|
|
|
|
}
|
|
|
|
|
2013-10-24 17:08:58 +02:00
|
|
|
private:
|
2015-04-15 14:14:10 +02:00
|
|
|
libconfig::Config _config;
|
2013-10-24 17:08:58 +02:00
|
|
|
|
2015-04-15 14:14:10 +02:00
|
|
|
std::string _wordMapFilePath;
|
2013-11-28 16:47:57 +01:00
|
|
|
|
2015-04-15 14:14:10 +02:00
|
|
|
std::string _hashedIndexFilePath;
|
2013-11-28 16:47:57 +01:00
|
|
|
|
2015-04-15 14:14:10 +02:00
|
|
|
std::string _markersFilePath;
|
2014-02-20 10:49:17 +01:00
|
|
|
|
2015-04-15 14:14:10 +02:00
|
|
|
std::string _htmlTagsFilePath;
|
2014-04-29 14:46:04 +02:00
|
|
|
|
2015-04-15 14:14:10 +02:00
|
|
|
std::string _spaceSymbolsFilePath;
|
2014-04-29 14:46:04 +02:00
|
|
|
|
2015-04-21 21:33:08 +02:00
|
|
|
bool _stopWordsEnabled;
|
|
|
|
|
2015-04-15 14:14:10 +02:00
|
|
|
std::string _stopWordsFilePath;
|
2014-04-29 14:46:04 +02:00
|
|
|
|
2015-04-15 14:14:10 +02:00
|
|
|
std::string _namedEntitiesFilePath;
|
2014-04-29 14:46:04 +02:00
|
|
|
|
2015-04-15 14:14:10 +02:00
|
|
|
std::string _stopSymbolsFilePath;
|
2014-04-29 14:46:04 +02:00
|
|
|
|
2015-04-16 11:39:39 +02:00
|
|
|
double _anubisThreshold;
|
|
|
|
|
2015-04-15 14:14:10 +02:00
|
|
|
std::string _readConfigParameterStr(const std::string & name)
|
2013-10-24 17:08:58 +02:00
|
|
|
throw(ConcordiaException);
|
2015-04-30 21:15:18 +02:00
|
|
|
|
|
|
|
std::string _readConfigParameterStr(const std::string & name,
|
|
|
|
const std::string & defaultValue)
|
|
|
|
throw(ConcordiaException);
|
2013-10-24 17:08:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|