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>
|
|
|
|
#include "concordia/word_map.hpp"
|
2013-11-12 22:08:37 +01:00
|
|
|
#include "concordia/concordia_exception.hpp"
|
2013-11-12 16:58:31 +01:00
|
|
|
|
|
|
|
/*!
|
|
|
|
Class for generating a sentence hash.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
class HashGenerator {
|
|
|
|
public:
|
2013-11-14 15:44:50 +01:00
|
|
|
explicit HashGenerator(const string & wordMapFilename)
|
|
|
|
throw(ConcordiaException);
|
|
|
|
|
2013-11-12 16:58:31 +01:00
|
|
|
/*! Destructor.
|
|
|
|
*/
|
|
|
|
virtual ~HashGenerator();
|
|
|
|
|
|
|
|
vector<int> generateHash(const string & sentence);
|
|
|
|
|
|
|
|
void serializeWordMap();
|
|
|
|
|
|
|
|
private:
|
2013-11-14 15:44:50 +01:00
|
|
|
boost::shared_ptr<WordMap> _wordMap;
|
2013-11-12 16:58:31 +01:00
|
|
|
|
2013-11-14 15:44:50 +01:00
|
|
|
string _wordMapFilename;
|
2013-11-12 16:58:31 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|