2012-02-20 04:46:08 +04:00
|
|
|
#ifndef MERT_CDER_SCORER_H_
|
|
|
|
#define MERT_CDER_SCORER_H_
|
2011-08-19 01:35:16 +04:00
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
#include <iostream>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include "Types.h"
|
|
|
|
#include "Scorer.h"
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
class CderScorer: public StatisticsBasedScorer
|
|
|
|
{
|
|
|
|
public:
|
2011-11-12 04:51:27 +04:00
|
|
|
explicit CderScorer(const string& config);
|
2011-11-12 05:16:31 +04:00
|
|
|
~CderScorer();
|
|
|
|
|
2011-08-19 01:35:16 +04:00
|
|
|
virtual void setReferenceFiles(const vector<string>& referenceFiles);
|
2012-02-01 16:44:37 +04:00
|
|
|
|
|
|
|
virtual void prepareStats(size_t sid, const string& text, ScoreStats& entry);
|
|
|
|
|
2011-08-19 01:35:16 +04:00
|
|
|
virtual void prepareStatsVector(size_t sid, const string& text, vector<int>& stats);
|
|
|
|
|
2011-11-12 05:58:14 +04:00
|
|
|
virtual size_t NumberOfScores() const {
|
2011-08-19 01:35:16 +04:00
|
|
|
return 2;
|
2011-11-12 04:40:01 +04:00
|
|
|
}
|
2011-08-19 01:35:16 +04:00
|
|
|
|
2011-11-12 05:40:54 +04:00
|
|
|
virtual float calculateScore(const vector<int>& comps) const;
|
2011-08-19 01:35:16 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
typedef vector<int> sent_t;
|
2012-02-01 15:54:20 +04:00
|
|
|
vector<vector<sent_t> > m_ref_sentences;
|
2011-08-19 01:35:16 +04:00
|
|
|
|
2011-11-12 05:58:14 +04:00
|
|
|
vector<int> computeCD(const sent_t& cand, const sent_t& ref) const;
|
2011-08-19 01:35:16 +04:00
|
|
|
|
2011-11-12 04:24:19 +04:00
|
|
|
// no copying allowed
|
2011-08-19 01:35:16 +04:00
|
|
|
CderScorer(const CderScorer&);
|
|
|
|
CderScorer& operator=(const CderScorer&);
|
|
|
|
};
|
|
|
|
|
2012-02-20 04:46:08 +04:00
|
|
|
#endif // MERT_CDER_SCORER_H_
|