mosesdecoder/mert/CderScorer.h
2012-05-02 22:03:58 +02:00

42 lines
1011 B
C++

#ifndef MERT_CDER_SCORER_H_
#define MERT_CDER_SCORER_H_
#include <string>
#include <vector>
#include "Types.h"
#include "Scorer.h"
using namespace std;
class CderScorer: public StatisticsBasedScorer {
public:
explicit CderScorer(const string& config, bool longJumps = true);
~CderScorer();
virtual void setReferenceFiles(const vector<string>& referenceFiles);
virtual void prepareStats(size_t sid, const string& text, ScoreStats& entry);
virtual void prepareStatsVector(size_t sid, const string& text, vector<int>& stats);
virtual size_t NumberOfScores() const { return 2; }
virtual float calculateScore(const vector<int>& comps) const;
private:
bool longJumpsAllowed;
typedef vector<int> sent_t;
vector<vector<sent_t> > m_ref_sentences;
void computeCD(const sent_t& cand, const sent_t& ref,
vector<int>& stats) const;
// no copying allowed
CderScorer(const CderScorer&);
CderScorer& operator=(const CderScorer&);
};
#endif // MERT_CDER_SCORER_H_