summaryrefslogtreecommitdiff
path: root/extractor/features/target_given_source_coherent_test.cc
blob: c54c06c2e3eed9a5ea855fc88f30c873cd39445f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <gtest/gtest.h>

#include <memory>
#include <string>

#include "target_given_source_coherent.h"

using namespace std;
using namespace ::testing;

namespace {

class TargetGivenSourceCoherentTest : public Test {
 protected:
  virtual void SetUp() {
    feature = make_shared<TargetGivenSourceCoherent>();
  }

  shared_ptr<TargetGivenSourceCoherent> feature;
};

TEST_F(TargetGivenSourceCoherentTest, TestGetName) {
  EXPECT_EQ("EgivenFCoherent", feature->GetName());
}

TEST_F(TargetGivenSourceCoherentTest, TestScore) {
  Phrase phrase;
  FeatureContext context(phrase, phrase, 0.3, 2, 20);
  EXPECT_EQ(1.0, feature->Score(context));

  context = FeatureContext(phrase, phrase, 1.9, 0, 1);
  EXPECT_EQ(99.0, feature->Score(context));
}

}  // namespace