summaryrefslogtreecommitdiff
path: root/mteval/wer.h
blob: 3a799f58f41e2023cd1edb1a933523567bb49a2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef WER_H_
#define WER_H_

#include "scorer.h"

class WERScorer : public SentenceScorer {
 public:
  WERScorer(const std::vector<std::vector<WordID> >& references);
  ~WERScorer();
  ScoreP ScoreCandidate(const std::vector<WordID>& hyp) const;
  ScoreP ScoreCCandidate(const std::vector<WordID>& hyp) const;
  static ScoreP ScoreFromString(const std::string& data);
  float Calculate(const std::vector<WordID>& hyp, const Sentence& ref, int& edits, int& char_count) const;
};

#endif