diff options
author | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2012-04-07 16:58:55 +0200 |
---|---|---|
committer | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2012-04-07 16:58:55 +0200 |
commit | 715245dc7042ac0dca4fea94031d7c6de8058033 (patch) | |
tree | 3a7ff0b88f2e113a08aef663d2487edec0b5f67f /mteval | |
parent | 89211ab30937672d84a54fac8fa435805499e38d (diff) | |
parent | 6001b81eba37985d2e7dea6e6ebb488b787789a6 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mteval')
-rw-r--r-- | mteval/aer_scorer.cc | 6 | ||||
-rw-r--r-- | mteval/ns.cc | 9 |
2 files changed, 7 insertions, 8 deletions
diff --git a/mteval/aer_scorer.cc b/mteval/aer_scorer.cc index edd4390f..ae3192d4 100644 --- a/mteval/aer_scorer.cc +++ b/mteval/aer_scorer.cc @@ -5,7 +5,7 @@ #include <sstream> #include "tdict.h" -#include "alignment_pharaoh.h" +#include "alignment_io.h" using namespace std; @@ -85,7 +85,7 @@ AERScorer::AERScorer(const vector<vector<WordID> >& refs, const string& src) : s cerr << "AERScorer can only take a single reference!\n"; abort(); } - ref_ = AlignmentPharaoh::ReadPharaohAlignmentGrid(TD::GetString(refs.front())); + ref_ = AlignmentIO::ReadPharaohAlignmentGrid(TD::GetString(refs.front())); } static inline bool Safe(const Array2D<bool>& a, int i, int j) { @@ -101,7 +101,7 @@ ScoreP AERScorer::ScoreCCandidate(const vector<WordID>& shyp) const { ScoreP AERScorer::ScoreCandidate(const vector<WordID>& shyp) const { boost::shared_ptr<Array2D<bool> > hyp = - AlignmentPharaoh::ReadPharaohAlignmentGrid(TD::GetString(shyp)); + AlignmentIO::ReadPharaohAlignmentGrid(TD::GetString(shyp)); int m = 0; int r = 0; diff --git a/mteval/ns.cc b/mteval/ns.cc index 788f809a..8d354677 100644 --- a/mteval/ns.cc +++ b/mteval/ns.cc @@ -14,7 +14,6 @@ #include "stringlib.h" using namespace std; -using boost::shared_ptr; map<string, EvaluationMetric*> EvaluationMetric::instances_; @@ -35,8 +34,8 @@ struct DefaultSegmentEvaluator : public SegmentEvaluator { const EvaluationMetric* em_; }; -shared_ptr<SegmentEvaluator> EvaluationMetric::CreateSegmentEvaluator(const vector<vector<WordID> >& refs) const { - return shared_ptr<SegmentEvaluator>(new DefaultSegmentEvaluator(refs, this)); +boost::shared_ptr<SegmentEvaluator> EvaluationMetric::CreateSegmentEvaluator(const vector<vector<WordID> >& refs) const { + return boost::shared_ptr<SegmentEvaluator>(new DefaultSegmentEvaluator(refs, this)); } #define MAX_SS_VECTOR_SIZE 50 @@ -184,8 +183,8 @@ template <unsigned int N = 4u, BleuType BrevityType = IBM> struct BleuMetric : public EvaluationMetric { BleuMetric() : EvaluationMetric(BrevityType == IBM ? "IBM_BLEU" : (BrevityType == Koehn ? "KOEHN_BLEU" : "NIST_BLEU")) {} unsigned SufficientStatisticsVectorSize() const { return N*2 + 2; } - shared_ptr<SegmentEvaluator> CreateSegmentEvaluator(const vector<vector<WordID> >& refs) const { - return shared_ptr<SegmentEvaluator>(new BleuSegmentEvaluator<N,BrevityType>(refs, this)); + boost::shared_ptr<SegmentEvaluator> CreateSegmentEvaluator(const vector<vector<WordID> >& refs) const { + return boost::shared_ptr<SegmentEvaluator>(new BleuSegmentEvaluator<N,BrevityType>(refs, this)); } float ComputeBreakdown(const SufficientStats& stats, float* bp, vector<float>* out) const { if (out) { out->clear(); } |