diff options
author | mjdenkowski <michael.j.denkowski@gmail.com> | 2013-08-28 18:07:42 -0400 |
---|---|---|
committer | mjdenkowski <michael.j.denkowski@gmail.com> | 2013-08-28 18:07:42 -0400 |
commit | 6f462d23384b6e42a944feedaf6f37ae7a5b7921 (patch) | |
tree | 5aeb4ef2b9e3e83182d43f89dc637297d6e1bbad /mteval/scorer.h | |
parent | 03799a2d330c6dbbe12154d4bcea236210b4f6ed (diff) |
Stream support for MIRA (part of realtime)
Diffstat (limited to 'mteval/scorer.h')
-rw-r--r-- | mteval/scorer.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/mteval/scorer.h b/mteval/scorer.h index 8bd76982..56c39a7d 100644 --- a/mteval/scorer.h +++ b/mteval/scorer.h @@ -83,10 +83,11 @@ class SentenceScorer { //TODO: should be able to GetOne GetZero without supplying sentence (just type) class DocScorer { + friend class DocStreamScorer; public: - ~DocScorer(); + virtual ~DocScorer(); DocScorer() { } - void Init(const ScoreType type, + virtual void Init(const ScoreType type, const std::vector<std::string>& ref_files, const std::string& src_file = "", bool verbose=false @@ -102,9 +103,30 @@ class DocScorer { int size() const { return scorers_.size(); } ScorerP operator[](size_t i) const { return scorers_[i]; } + virtual void update(const std::string& ref) {} private: + ScoreType type; std::vector<ScorerP> scorers_; }; +class DocStreamScorer : public DocScorer { + public: + void Init(const ScoreType type, + const std::vector<std::string>& ref_files, + const std::string& src_file = "", + bool verbose=false + ); + DocStreamScorer(const ScoreType type, + const std::vector<std::string>& ref_files, + const std::string& src_file = "", + bool verbose=false + ) + { + Init(type,ref_files,src_file,verbose); + } + ScorerP operator[](size_t i); + int size(); + void update(const std::string& ref); +}; #endif |