2013-11-12 16:58:31 +01:00
|
|
|
#ifndef HASH_GENERATOR_HDR
|
|
|
|
#define HASH_GENERATOR_HDR
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <map>
|
|
|
|
#include <vector>
|
2013-11-14 15:44:50 +01:00
|
|
|
#include <boost/shared_ptr.hpp>
|
2014-03-14 11:30:17 +01:00
|
|
|
#include <boost/algorithm/string/predicate.hpp>
|
2013-11-14 15:44:50 +01:00
|
|
|
#include "concordia/word_map.hpp"
|
2013-12-06 22:29:25 +01:00
|
|
|
#include "concordia/common/config.hpp"
|
2014-04-13 12:21:30 +02:00
|
|
|
#include "concordia/sentence_anonymizer.hpp"
|
|
|
|
#include "concordia/concordia_config.hpp"
|
2013-11-12 22:08:37 +01:00
|
|
|
#include "concordia/concordia_exception.hpp"
|
2013-11-12 16:58:31 +01:00
|
|
|
|
2013-11-20 17:43:29 +01:00
|
|
|
|
2013-11-12 16:58:31 +01:00
|
|
|
/*!
|
|
|
|
Class for generating a sentence hash.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
class HashGenerator {
|
|
|
|
public:
|
2014-04-13 12:21:30 +02:00
|
|
|
explicit HashGenerator(boost::shared_ptr<ConcordiaConfig> config)
|
|
|
|
throw(ConcordiaException);
|
2013-11-14 15:44:50 +01:00
|
|
|
|
2013-11-12 16:58:31 +01:00
|
|
|
/*! Destructor.
|
|
|
|
*/
|
|
|
|
virtual ~HashGenerator();
|
|
|
|
|
2015-04-15 10:55:26 +02:00
|
|
|
vector<INDEX_CHARACTER_TYPE> generateHash(const string & sentence)
|
2014-03-14 11:30:17 +01:00
|
|
|
throw(ConcordiaException);
|
2013-11-12 16:58:31 +01:00
|
|
|
|
2015-04-15 10:55:26 +02:00
|
|
|
vector<string> generateTokenVector(const string & sentence);
|
2014-04-29 14:46:04 +02:00
|
|
|
|
2013-11-12 16:58:31 +01:00
|
|
|
void serializeWordMap();
|
|
|
|
|
|
|
|
private:
|
2013-11-14 15:44:50 +01:00
|
|
|
boost::shared_ptr<WordMap> _wordMap;
|
2014-04-29 14:46:04 +02:00
|
|
|
|
2014-04-13 12:21:30 +02:00
|
|
|
boost::shared_ptr<SentenceAnonymizer> _sentenceAnonymizer;
|
2013-11-12 16:58:31 +01:00
|
|
|
|
2013-11-14 20:36:34 +01:00
|
|
|
string _wordMapFilePath;
|
2013-11-12 16:58:31 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|