-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Working version of the grammar extractor.
- Loading branch information
Showing
80 changed files
with
3,007 additions
and
700 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include <gtest/gtest.h> | ||
|
||
#include <memory> | ||
#include <string> | ||
|
||
#include "alignment.h" | ||
|
||
using namespace std; | ||
using namespace ::testing; | ||
|
||
namespace { | ||
|
||
class AlignmentTest : public Test { | ||
protected: | ||
virtual void SetUp() { | ||
alignment = make_shared<Alignment>("sample_alignment.txt"); | ||
} | ||
|
||
shared_ptr<Alignment> alignment; | ||
}; | ||
|
||
TEST_F(AlignmentTest, TestGetLinks) { | ||
vector<pair<int, int> > expected_links = { | ||
make_pair(0, 0), make_pair(1, 1), make_pair(2, 2) | ||
}; | ||
EXPECT_EQ(expected_links, alignment->GetLinks(0)); | ||
expected_links = {make_pair(1, 0), make_pair(2, 1)}; | ||
EXPECT_EQ(expected_links, alignment->GetLinks(1)); | ||
} | ||
|
||
} // namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include <gtest/gtest.h> | ||
|
||
#include <memory> | ||
#include <string> | ||
|
||
#include "count_source_target.h" | ||
|
||
using namespace std; | ||
using namespace ::testing; | ||
|
||
namespace { | ||
|
||
class CountSourceTargetTest : public Test { | ||
protected: | ||
virtual void SetUp() { | ||
feature = make_shared<CountSourceTarget>(); | ||
} | ||
|
||
shared_ptr<CountSourceTarget> feature; | ||
}; | ||
|
||
TEST_F(CountSourceTargetTest, TestGetName) { | ||
EXPECT_EQ("CountEF", feature->GetName()); | ||
} | ||
|
||
TEST_F(CountSourceTargetTest, TestScore) { | ||
Phrase phrase; | ||
FeatureContext context(phrase, phrase, 0.5, 9, 13); | ||
EXPECT_EQ(1.0, feature->Score(context)); | ||
} | ||
|
||
} // namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#include "feature.h" | ||
|
||
const double Feature::MAX_SCORE = 99.0; | ||
|
||
Feature::~Feature() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.