Concordia
hash_generator.hpp
1 #ifndef HASH_GENERATOR_HDR
2 #define HASH_GENERATOR_HDR
3 
4 #include <string>
5 #include <map>
6 #include <vector>
7 #include <boost/shared_ptr.hpp>
8 #include <boost/algorithm/string/predicate.hpp>
9 #include "concordia/word_map.hpp"
10 #include "concordia/common/config.hpp"
11 #include "concordia/sentence_tokenizer.hpp"
12 #include "concordia/concordia_config.hpp"
13 #include "concordia/concordia_exception.hpp"
14 
15 
30 public:
36  explicit HashGenerator(std::string indexPath,
37  boost::shared_ptr<ConcordiaConfig> config)
38  throw(ConcordiaException);
39 
42  virtual ~HashGenerator();
43 
50  TokenizedSentence generateHash(const std::string & sentence,
51  bool byWhitespace = false)
52  throw(ConcordiaException);
53 
61  TokenizedSentence generateTokens(const std::string & sentence,
62  bool byWhitespace = false)
63  throw(ConcordiaException);
64 
68  void serializeWordMap();
69 
73  void clearWordMap();
74 
75 private:
76  boost::shared_ptr<WordMap> _wordMap;
77 
78  boost::shared_ptr<SentenceTokenizer> _sentenceTokenizer;
79 
80  std::string _wordMapFilePath;
81 };
82 
83 #endif
Definition: concordia_exception.hpp:11
HashGenerator(std::string indexPath, boost::shared_ptr< ConcordiaConfig > config)
Definition: hash_generator.cpp:13
void serializeWordMap()
Definition: hash_generator.cpp:57
virtual ~HashGenerator()
Definition: hash_generator.cpp:28
Definition: tokenized_sentence.hpp:26
void clearWordMap()
Definition: hash_generator.cpp:63
Definition: hash_generator.hpp:29
TokenizedSentence generateTokens(const std::string &sentence, bool byWhitespace=false)
Definition: hash_generator.cpp:44
TokenizedSentence generateHash(const std::string &sentence, bool byWhitespace=false)
Definition: hash_generator.cpp:31