summaryrefslogtreecommitdiff
path: root/extractor/binary_search_merger.h
diff options
context:
space:
mode:
authorPaul Baltescu <pauldb89@gmail.com>2013-02-22 16:52:25 +0000
committerPaul Baltescu <pauldb89@gmail.com>2013-02-22 16:52:25 +0000
commit6717daa034bfcfa429275f64d84607ae1568d488 (patch)
treec04c1546eed0e9acaa21907a5f8ab5aedc1a08fc /extractor/binary_search_merger.h
parentbb79fdc140a5593124d3943769a644c6cc3d87f6 (diff)
parentd69c289e172562039bcbe987657280332ab6315e (diff)
Merge branch 'master' into experiment
Diffstat (limited to 'extractor/binary_search_merger.h')
-rw-r--r--extractor/binary_search_merger.h75
1 files changed, 0 insertions, 75 deletions
diff --git a/extractor/binary_search_merger.h b/extractor/binary_search_merger.h
deleted file mode 100644
index c887e012..00000000
--- a/extractor/binary_search_merger.h
+++ /dev/null
@@ -1,75 +0,0 @@
-#ifndef _BINARY_SEARCH_MERGER_H_
-#define _BINARY_SEARCH_MERGER_H_
-
-#include <memory>
-#include <vector>
-
-using namespace std;
-
-class DataArray;
-class LinearMerger;
-class MatchingComparator;
-class Phrase;
-class Vocabulary;
-
-class BinarySearchMerger {
- public:
- BinarySearchMerger(shared_ptr<Vocabulary> vocabulary,
- shared_ptr<LinearMerger> linear_merger,
- shared_ptr<DataArray> data_array,
- shared_ptr<MatchingComparator> comparator,
- bool force_binary_search_merge = false);
-
- virtual ~BinarySearchMerger();
-
- virtual void Merge(
- vector<int>& locations, const Phrase& phrase, const Phrase& suffix,
- const vector<int>::iterator& prefix_start,
- const vector<int>::iterator& prefix_end,
- const vector<int>::iterator& suffix_start,
- const vector<int>::iterator& suffix_end,
- int prefix_subpatterns, int suffix_subpatterns) const;
-
- static double BAEZA_YATES_FACTOR;
-
- protected:
- BinarySearchMerger();
-
- private:
- bool IsIntersectionVoid(
- vector<int>::iterator prefix_start, vector<int>::iterator prefix_end,
- vector<int>::iterator suffix_start, vector<int>::iterator suffix_end,
- int prefix_subpatterns, int suffix_subpatterns,
- const Phrase& suffix) const;
-
- bool ShouldUseLinearMerge(int prefix_set_size, int suffix_set_size) const;
-
- vector<int>::iterator GetMiddle(vector<int>::iterator low,
- vector<int>::iterator high,
- int num_subpatterns) const;
-
- void GetComparableMatchings(
- const vector<int>::iterator& prefix_start,
- const vector<int>::iterator& prefix_end,
- const vector<int>::iterator& prefix_mid,
- int num_subpatterns,
- vector<int>::iterator& prefix_low,
- vector<int>::iterator& prefix_high) const;
-
- int CompareMatchingsSet(
- const vector<int>::iterator& prefix_low,
- const vector<int>::iterator& prefix_high,
- const vector<int>::iterator& suffix_mid,
- int prefix_subpatterns,
- int suffix_subpatterns,
- const Phrase& suffix) const;
-
- shared_ptr<Vocabulary> vocabulary;
- shared_ptr<LinearMerger> linear_merger;
- shared_ptr<DataArray> data_array;
- shared_ptr<MatchingComparator> comparator;
- // Should be true only for testing.
- bool force_binary_search_merge;
-};
-
-#endif