summaryrefslogtreecommitdiff
path: root/extractor
diff options
context:
space:
mode:
authorPaul Baltescu <pauldb89@gmail.com>2013-03-06 17:13:13 +0000
committerPaul Baltescu <pauldb89@gmail.com>2013-03-06 17:13:13 +0000
commit41b2aae5cf08899da5c46e944ead4ddf6639a3f0 (patch)
tree4a68011a4f7780e24a573f06a8437de0742c5d6f /extractor
parent892b0820ce03268bf4c55bed8a8f697009f67f36 (diff)
Fix broken test & includes.
Diffstat (limited to 'extractor')
-rw-r--r--extractor/features/feature.h3
-rw-r--r--extractor/features/max_lex_source_given_target.cc4
-rw-r--r--extractor/features/max_lex_source_given_target_test.cc8
-rw-r--r--extractor/features/max_lex_target_given_source.cc4
-rw-r--r--extractor/features/max_lex_target_given_source_test.cc8
-rw-r--r--extractor/mocks/mock_alignment.h2
-rw-r--r--extractor/mocks/mock_data_array.h2
-rw-r--r--extractor/mocks/mock_fast_intersector.h6
-rw-r--r--extractor/mocks/mock_feature.h2
-rw-r--r--extractor/mocks/mock_matchings_finder.h4
-rw-r--r--extractor/mocks/mock_precomputation.h2
-rw-r--r--extractor/mocks/mock_rule_extractor.h8
-rw-r--r--extractor/mocks/mock_rule_extractor_helper.h2
-rw-r--r--extractor/mocks/mock_rule_factory.h4
-rw-r--r--extractor/mocks/mock_sampler.h4
-rw-r--r--extractor/mocks/mock_scorer.h4
-rw-r--r--extractor/mocks/mock_suffix_array.h6
-rw-r--r--extractor/mocks/mock_target_phrase_extractor.h2
-rw-r--r--extractor/mocks/mock_translation_table.h2
-rw-r--r--extractor/mocks/mock_vocabulary.h2
-rw-r--r--extractor/precomputation_test.cc19
21 files changed, 48 insertions, 50 deletions
diff --git a/extractor/features/feature.h b/extractor/features/feature.h
index de2827bc..6693ccbf 100644
--- a/extractor/features/feature.h
+++ b/extractor/features/feature.h
@@ -3,8 +3,7 @@
#include <string>
-//TODO(pauldb): include headers nicely.
-#include "../phrase.h"
+#include "phrase.h"
using namespace std;
diff --git a/extractor/features/max_lex_source_given_target.cc b/extractor/features/max_lex_source_given_target.cc
index 3ffe598c..65d0ec68 100644
--- a/extractor/features/max_lex_source_given_target.cc
+++ b/extractor/features/max_lex_source_given_target.cc
@@ -2,8 +2,8 @@
#include <cmath>
-#include "../data_array.h"
-#include "../translation_table.h"
+#include "data_array.h"
+#include "translation_table.h"
namespace extractor {
namespace features {
diff --git a/extractor/features/max_lex_source_given_target_test.cc b/extractor/features/max_lex_source_given_target_test.cc
index c1edb483..7f6aae41 100644
--- a/extractor/features/max_lex_source_given_target_test.cc
+++ b/extractor/features/max_lex_source_given_target_test.cc
@@ -4,10 +4,10 @@
#include <memory>
#include <string>
-#include "../mocks/mock_translation_table.h"
-#include "../mocks/mock_vocabulary.h"
-#include "../data_array.h"
-#include "../phrase_builder.h"
+#include "data_array.h"
+#include "mocks/mock_translation_table.h"
+#include "mocks/mock_vocabulary.h"
+#include "phrase_builder.h"
#include "max_lex_source_given_target.h"
using namespace std;
diff --git a/extractor/features/max_lex_target_given_source.cc b/extractor/features/max_lex_target_given_source.cc
index 30140d80..33783054 100644
--- a/extractor/features/max_lex_target_given_source.cc
+++ b/extractor/features/max_lex_target_given_source.cc
@@ -2,8 +2,8 @@
#include <cmath>
-#include "../data_array.h"
-#include "../translation_table.h"
+#include "data_array.h"
+#include "translation_table.h"
namespace extractor {
namespace features {
diff --git a/extractor/features/max_lex_target_given_source_test.cc b/extractor/features/max_lex_target_given_source_test.cc
index 9ceb13e5..6d0efd9c 100644
--- a/extractor/features/max_lex_target_given_source_test.cc
+++ b/extractor/features/max_lex_target_given_source_test.cc
@@ -4,10 +4,10 @@
#include <memory>
#include <string>
-#include "../mocks/mock_translation_table.h"
-#include "../mocks/mock_vocabulary.h"
-#include "../data_array.h"
-#include "../phrase_builder.h"
+#include "data_array.h"
+#include "mocks/mock_translation_table.h"
+#include "mocks/mock_vocabulary.h"
+#include "phrase_builder.h"
#include "max_lex_target_given_source.h"
using namespace std;
diff --git a/extractor/mocks/mock_alignment.h b/extractor/mocks/mock_alignment.h
index 3d745e9d..299c3d1c 100644
--- a/extractor/mocks/mock_alignment.h
+++ b/extractor/mocks/mock_alignment.h
@@ -1,6 +1,6 @@
#include <gmock/gmock.h>
-#include "../alignment.h"
+#include "alignment.h"
namespace extractor {
diff --git a/extractor/mocks/mock_data_array.h b/extractor/mocks/mock_data_array.h
index cf9f3671..6f85abb4 100644
--- a/extractor/mocks/mock_data_array.h
+++ b/extractor/mocks/mock_data_array.h
@@ -1,6 +1,6 @@
#include <gmock/gmock.h>
-#include "../data_array.h"
+#include "data_array.h"
namespace extractor {
diff --git a/extractor/mocks/mock_fast_intersector.h b/extractor/mocks/mock_fast_intersector.h
index 665add65..f0b628d7 100644
--- a/extractor/mocks/mock_fast_intersector.h
+++ b/extractor/mocks/mock_fast_intersector.h
@@ -1,8 +1,8 @@
#include <gmock/gmock.h>
-#include "../fast_intersector.h"
-#include "../phrase.h"
-#include "../phrase_location.h"
+#include "fast_intersector.h"
+#include "phrase.h"
+#include "phrase_location.h"
namespace extractor {
diff --git a/extractor/mocks/mock_feature.h b/extractor/mocks/mock_feature.h
index 19ba4de9..0b0f0ead 100644
--- a/extractor/mocks/mock_feature.h
+++ b/extractor/mocks/mock_feature.h
@@ -1,6 +1,6 @@
#include <gmock/gmock.h>
-#include "../features/feature.h"
+#include "features/feature.h"
namespace extractor {
namespace features {
diff --git a/extractor/mocks/mock_matchings_finder.h b/extractor/mocks/mock_matchings_finder.h
index ffbb06c7..827526fd 100644
--- a/extractor/mocks/mock_matchings_finder.h
+++ b/extractor/mocks/mock_matchings_finder.h
@@ -1,7 +1,7 @@
#include <gmock/gmock.h>
-#include "../matchings_finder.h"
-#include "../phrase_location.h"
+#include "matchings_finder.h"
+#include "phrase_location.h"
namespace extractor {
diff --git a/extractor/mocks/mock_precomputation.h b/extractor/mocks/mock_precomputation.h
index 64934b94..8753343e 100644
--- a/extractor/mocks/mock_precomputation.h
+++ b/extractor/mocks/mock_precomputation.h
@@ -1,6 +1,6 @@
#include <gmock/gmock.h>
-#include "../precomputation.h"
+#include "precomputation.h"
namespace extractor {
diff --git a/extractor/mocks/mock_rule_extractor.h b/extractor/mocks/mock_rule_extractor.h
index 28b644b0..aad11651 100644
--- a/extractor/mocks/mock_rule_extractor.h
+++ b/extractor/mocks/mock_rule_extractor.h
@@ -1,9 +1,9 @@
#include <gmock/gmock.h>
-#include "../phrase.h"
-#include "../phrase_builder.h"
-#include "../rule.h"
-#include "../rule_extractor.h"
+#include "phrase.h"
+#include "phrase_builder.h"
+#include "rule.h"
+#include "rule_extractor.h"
namespace extractor {
diff --git a/extractor/mocks/mock_rule_extractor_helper.h b/extractor/mocks/mock_rule_extractor_helper.h
index 3b0ac0f5..cf196ab5 100644
--- a/extractor/mocks/mock_rule_extractor_helper.h
+++ b/extractor/mocks/mock_rule_extractor_helper.h
@@ -2,7 +2,7 @@
#include <vector>
-#include "../rule_extractor_helper.h"
+#include "rule_extractor_helper.h"
using namespace std;
diff --git a/extractor/mocks/mock_rule_factory.h b/extractor/mocks/mock_rule_factory.h
index 11cb9ab5..7389b396 100644
--- a/extractor/mocks/mock_rule_factory.h
+++ b/extractor/mocks/mock_rule_factory.h
@@ -1,7 +1,7 @@
#include <gmock/gmock.h>
-#include "../grammar.h"
-#include "../rule_factory.h"
+#include "grammar.h"
+#include "rule_factory.h"
namespace extractor {
diff --git a/extractor/mocks/mock_sampler.h b/extractor/mocks/mock_sampler.h
index 7022f7b3..75c43c27 100644
--- a/extractor/mocks/mock_sampler.h
+++ b/extractor/mocks/mock_sampler.h
@@ -1,7 +1,7 @@
#include <gmock/gmock.h>
-#include "../phrase_location.h"
-#include "../sampler.h"
+#include "phrase_location.h"
+#include "sampler.h"
namespace extractor {
diff --git a/extractor/mocks/mock_scorer.h b/extractor/mocks/mock_scorer.h
index 4d593ddf..cc0c444d 100644
--- a/extractor/mocks/mock_scorer.h
+++ b/extractor/mocks/mock_scorer.h
@@ -1,7 +1,7 @@
#include <gmock/gmock.h>
-#include "../scorer.h"
-#include "../features/feature.h"
+#include "scorer.h"
+#include "features/feature.h"
namespace extractor {
diff --git a/extractor/mocks/mock_suffix_array.h b/extractor/mocks/mock_suffix_array.h
index 6886232a..7018acc7 100644
--- a/extractor/mocks/mock_suffix_array.h
+++ b/extractor/mocks/mock_suffix_array.h
@@ -3,9 +3,9 @@
#include <memory>
#include <string>
-#include "../data_array.h"
-#include "../phrase_location.h"
-#include "../suffix_array.h"
+#include "data_array.h"
+#include "phrase_location.h"
+#include "suffix_array.h"
using namespace std;
diff --git a/extractor/mocks/mock_target_phrase_extractor.h b/extractor/mocks/mock_target_phrase_extractor.h
index e5e9aeab..6aad853c 100644
--- a/extractor/mocks/mock_target_phrase_extractor.h
+++ b/extractor/mocks/mock_target_phrase_extractor.h
@@ -1,6 +1,6 @@
#include <gmock/gmock.h>
-#include "../target_phrase_extractor.h"
+#include "target_phrase_extractor.h"
namespace extractor {
diff --git a/extractor/mocks/mock_translation_table.h b/extractor/mocks/mock_translation_table.h
index 358c854f..307e4282 100644
--- a/extractor/mocks/mock_translation_table.h
+++ b/extractor/mocks/mock_translation_table.h
@@ -1,6 +1,6 @@
#include <gmock/gmock.h>
-#include "../translation_table.h"
+#include "translation_table.h"
namespace extractor {
diff --git a/extractor/mocks/mock_vocabulary.h b/extractor/mocks/mock_vocabulary.h
index 802c29b4..042c9ce2 100644
--- a/extractor/mocks/mock_vocabulary.h
+++ b/extractor/mocks/mock_vocabulary.h
@@ -1,6 +1,6 @@
#include <gmock/gmock.h>
-#include "../vocabulary.h"
+#include "vocabulary.h"
namespace extractor {
diff --git a/extractor/precomputation_test.cc b/extractor/precomputation_test.cc
index 04e3850d..363febb7 100644
--- a/extractor/precomputation_test.cc
+++ b/extractor/precomputation_test.cc
@@ -40,7 +40,6 @@ TEST_F(PrecomputationTest, TestCollocations) {
Precomputation precomputation(suffix_array, 3, 3, 10, 5, 1, 4, 2);
Index collocations = precomputation.GetCollocations();
- EXPECT_EQ(-1, precomputation.NON_TERMINAL);
vector<int> key = {2, 3, -1, 2};
vector<int> expected_value = {1, 5, 1, 8, 5, 8, 5, 11, 8, 11};
EXPECT_EQ(expected_value, collocations[key]);
@@ -69,33 +68,33 @@ TEST_F(PrecomputationTest, TestCollocations) {
expected_value = {1, 6, 1, 9, 5, 9};
EXPECT_EQ(expected_value, collocations[key]);
- key = {2, -1, 2, -1, 2};
+ key = {2, -1, 2, -2, 2};
expected_value = {1, 5, 8, 5, 8, 11};
EXPECT_EQ(expected_value, collocations[key]);
- key = {2, -1, 2, -1, 3};
+ key = {2, -1, 2, -2, 3};
expected_value = {1, 5, 9};
EXPECT_EQ(expected_value, collocations[key]);
- key = {2, -1, 3, -1, 2};
+ key = {2, -1, 3, -2, 2};
expected_value = {1, 6, 8, 5, 9, 11};
EXPECT_EQ(expected_value, collocations[key]);
- key = {2, -1, 3, -1, 3};
+ key = {2, -1, 3, -2, 3};
expected_value = {1, 6, 9};
EXPECT_EQ(expected_value, collocations[key]);
- key = {3, -1, 2, -1, 2};
+ key = {3, -1, 2, -2, 2};
expected_value = {2, 5, 8, 2, 5, 11, 2, 8, 11, 6, 8, 11};
EXPECT_EQ(expected_value, collocations[key]);
- key = {3, -1, 2, -1, 3};
+ key = {3, -1, 2, -2, 3};
expected_value = {2, 5, 9};
EXPECT_EQ(expected_value, collocations[key]);
- key = {3, -1, 3, -1, 2};
+ key = {3, -1, 3, -2, 2};
expected_value = {2, 6, 8, 2, 6, 11, 2, 9, 11, 6, 9, 11};
EXPECT_EQ(expected_value, collocations[key]);
- key = {3, -1, 3, -1, 3};
+ key = {3, -1, 3, -2, 3};
expected_value = {2, 6, 9};
EXPECT_EQ(expected_value, collocations[key]);
// Exceeds max_rule_symbols.
- key = {2, -1, 2, -1, 2, 3};
+ key = {2, -1, 2, -2, 2, 3};
EXPECT_EQ(0, collocations.count(key));
// Contains non frequent pattern.
key = {2, -1, 5};