concordia-library/concordia/concordia_config.hpp

86 lines
2.1 KiB
C++
Raw Normal View History

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
*/
2019-01-18 13:30:51 +01:00
explicit ConcordiaConfig(const std::string & configFilePath);
2013-10-24 17:08:58 +02:00
/*! Destructor.
*/
virtual ~ConcordiaConfig();
2015-04-30 22:22:54 +02:00
/*! Getter for html tags file path.
For more information see \ref tutorial3.
\returns html tags file path
*/
std::string & getHtmlTagsFilePath() {
return _htmlTagsFilePath;
}
2015-04-30 22:22:54 +02:00
/*! Getter for stop symbols enabled parameter.
For more information see \ref tutorial3.
\returns true if stop words are enabled
*/
bool & isStopWordsEnabled() {
return _stopWordsEnabled;
}
2015-04-30 22:22:54 +02:00
/*! Getter for stop words file path.
For more information see \ref tutorial3.
\returns stop words file path
*/
std::string & getStopWordsFilePath() {
return _stopWordsFilePath;
}
2015-04-30 22:22:54 +02:00
/*! Getter for named entities file path.
For more information see \ref tutorial3.
\returns named entities file path
*/
std::string & getNamedEntitiesFilePath() {
return _namedEntitiesFilePath;
}
2015-04-30 22:22:54 +02:00
/*! Getter for anubis threshold. Anubis search results with
scores below that threshold will be discarded.
\returns anubis threshold
*/
double getAnubisThreshold() {
return _anubisThreshold;
}
2013-10-24 17:08:58 +02:00
private:
libconfig::Config _config;
2013-10-24 17:08:58 +02:00
std::string _htmlTagsFilePath;
bool _stopWordsEnabled;
std::string _stopWordsFilePath;
std::string _namedEntitiesFilePath;
double _anubisThreshold;
2019-01-18 13:30:51 +01:00
std::string _readConfigParameterStr(const std::string & name);
2015-04-30 21:15:18 +02:00
std::string _readConfigParameterStr(const std::string & name,
2019-01-18 13:30:51 +01:00
const std::string & defaultValue);
2013-10-24 17:08:58 +02:00
};
#endif