summaryrefslogtreecommitdiff
path: root/mteval/ns_docscorer.h
blob: b3c28fc9a46aaaf175e81dea18125a2c2cf8e654 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef _NS_DOC_SCORER_H_
#define _NS_DOC_SCORER_H_

#include <vector>
#include <string>
#include <boost/shared_ptr.hpp>

class EvaluationMetric;
struct SegmentEvaluator;
class DocumentScorer {
 public:
  ~DocumentScorer();
  DocumentScorer();
  DocumentScorer(const EvaluationMetric* metric,
                 const std::vector<std::string>& ref_files,
                 const std::string& src_file = "",
                 bool verbose=false) {
    Init(metric,ref_files,src_file,verbose);
  }
  DocumentScorer(const EvaluationMetric* metric,
                 const std::string& src_ref_composite_file);
  int size() const { return scorers_.size(); }
  const SegmentEvaluator* operator[](size_t i) const { return scorers_[i].get(); }
 private:
  void Init(const EvaluationMetric* metric,
            const std::vector<std::string>& ref_files,
            const std::string& src_file = "",
            bool verbose=false);

  std::vector<boost::shared_ptr<SegmentEvaluator> > scorers_;
};

#endif