#ifndef __INTERPOLATED_SCORER_H__ #define __INTERPOLATED_SCORER_H__ #include #include #include #include #include #include #include #include #include #include #include "Types.h" #include "ScoreData.h" #include "Scorer.h" #include "ScopedVector.h" /** * Class that includes other scorers eg. * Interpolated HAMMING and BLEU scorer **/ class InterpolatedScorer : public Scorer { public: // name would be: "HAMMING,BLEU" or similar InterpolatedScorer(const string& name, const string& config); virtual ~InterpolatedScorer() {} virtual void score(const candidates_t& candidates, const diffs_t& diffs, statscores_t& scores) const; virtual void setReferenceFiles(const vector& referenceFiles); virtual void prepareStats(size_t sid, const string& text, ScoreStats& entry); virtual size_t NumberOfScores() const { size_t sz=0; for (ScopedVector::const_iterator itsc = _scorers.begin(); itsc != _scorers.end(); itsc++) { sz += (*itsc)->NumberOfScores(); } return sz; }; virtual void setScoreData(ScoreData* data); /** * Set the factors, which should be used for this metric */ virtual void setFactors(const string& factors); protected: ScopedVector _scorers; // Take the ownership of the heap-allocated the objects // by Scorer objects. ScopedVector m_scorers_score_data; vector _scorerWeights; }; #endif //__INTERPOLATED_SCORER_H