00001 #ifndef MERT_PER_SCORER_H_
00002 #define MERT_PER_SCORER_H_
00003
00004 #include <set>
00005 #include <string>
00006 #include <vector>
00007 #include "Types.h"
00008 #include "StatisticsBasedScorer.h"
00009
00010 namespace MosesTuning
00011 {
00012
00013
00014 class ScoreStats;
00015
00022 class PerScorer: public StatisticsBasedScorer
00023 {
00024 public:
00025 explicit PerScorer(const std::string& config = "");
00026 ~PerScorer();
00027
00028 virtual void setReferenceFiles(const std::vector<std::string>& referenceFiles);
00029 virtual void prepareStats(std::size_t sid, const std::string& text, ScoreStats& entry);
00030 virtual std::size_t NumberOfScores() const {
00031 return 3;
00032 }
00033 virtual float calculateScore(const std::vector<ScoreStatsType>& comps) const;
00034
00035 private:
00036
00037 PerScorer(const PerScorer&);
00038 PerScorer& operator=(const PerScorer&);
00039
00040
00041 std::vector<std::size_t> m_ref_lengths;
00042 std::vector<std::multiset<int> > m_ref_tokens;
00043 };
00044
00045 }
00046
00047 #endif // MERT_PER_SCORER_H_