summaryrefslogtreecommitdiff
path: root/extractor/intersector.h
diff options
context:
space:
mode:
authorPaul Baltescu <pauldb89@gmail.com>2013-02-14 23:17:15 +0000
committerPaul Baltescu <pauldb89@gmail.com>2013-02-14 23:17:15 +0000
commit63b30ed9c8510da8c8e2f6a456576424fddacc0e (patch)
tree1b5278fb5a4480b7f7a965bb6de8f6f9e9c4d333 /extractor/intersector.h
parent0a53f7eca74c165b5ce1c238f1999ddf1febea55 (diff)
Working version of the grammar extractor.
Diffstat (limited to 'extractor/intersector.h')
-rw-r--r--extractor/intersector.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/extractor/intersector.h b/extractor/intersector.h
index f023cc96..8b159f17 100644
--- a/extractor/intersector.h
+++ b/extractor/intersector.h
@@ -2,7 +2,7 @@
#define _INTERSECTOR_H_
#include <memory>
-#include <tr1/unordered_map>
+#include <unordered_map>
#include <vector>
#include <boost/functional/hash.hpp>
@@ -11,7 +11,6 @@
#include "linear_merger.h"
using namespace std;
-using namespace tr1;
typedef boost::hash<vector<int> > VectorHash;
typedef unordered_map<vector<int>, vector<int>, VectorHash> Index;
@@ -42,11 +41,16 @@ class Intersector {
shared_ptr<BinarySearchMerger> binary_search_merger,
bool use_baeza_yates);
- PhraseLocation Intersect(
+ virtual ~Intersector();
+
+ virtual PhraseLocation Intersect(
const Phrase& prefix, PhraseLocation& prefix_location,
const Phrase& suffix, PhraseLocation& suffix_location,
const Phrase& phrase);
+ protected:
+ Intersector();
+
private:
void ConvertIndexes(shared_ptr<Precomputation> precomputation,
shared_ptr<DataArray> data_array);
@@ -64,6 +68,12 @@ class Intersector {
Index inverted_index;
Index collocations;
bool use_baeza_yates;
+
+ // TODO(pauldb): Don't forget to remove these.
+ public:
+ double sort_time;
+ double linear_merge_time;
+ double binary_merge_time;
};
#endif