2014-04-13 12:21:30 +02:00
|
|
|
#ifndef SENTENCE_ANONYMIZER_HDR
|
|
|
|
#define SENTENCE_ANONYMIZER_HDR
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include "concordia/common/config.hpp"
|
2014-04-24 08:36:48 +02:00
|
|
|
#include "concordia/regex_replacement.hpp"
|
2014-04-13 12:21:30 +02:00
|
|
|
#include "concordia/concordia_config.hpp"
|
|
|
|
#include "concordia/concordia_exception.hpp"
|
|
|
|
#include <boost/shared_ptr.hpp>
|
2014-04-24 08:36:48 +02:00
|
|
|
#include <boost/ptr_container/ptr_vector.hpp>
|
2014-04-13 12:21:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Class for anonymizing sentence before adding to index.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
class SentenceAnonymizer {
|
|
|
|
public:
|
|
|
|
explicit SentenceAnonymizer(boost::shared_ptr<ConcordiaConfig> config)
|
|
|
|
throw(ConcordiaException);
|
|
|
|
|
|
|
|
/*! Destructor.
|
|
|
|
*/
|
|
|
|
virtual ~SentenceAnonymizer();
|
|
|
|
|
|
|
|
string anonymize(const string & sentence);
|
|
|
|
|
|
|
|
private:
|
2014-04-24 08:36:48 +02:00
|
|
|
|
|
|
|
boost::ptr_vector<RegexReplacement> _namedEntities;
|
|
|
|
|
|
|
|
boost::shared_ptr<RegexReplacement> _stopWords;
|
|
|
|
|
|
|
|
boost::shared_ptr<RegexReplacement> _stopSymbols;
|
|
|
|
|
|
|
|
boost::shared_ptr<RegexReplacement> _spaceSymbols;
|
2014-04-13 12:21:30 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|