summaryrefslogtreecommitdiff
path: root/mteval/scorer.h
diff options
context:
space:
mode:
authormjdenkowski <michael.j.denkowski@gmail.com>2013-08-28 18:07:42 -0400
committermjdenkowski <michael.j.denkowski@gmail.com>2013-08-28 18:07:42 -0400
commit0bc21f0fbcf5e060c1a9b249527e094436a383d8 (patch)
tree070c863b4a6734f2c8072e2cb610ac878a96bb31 /mteval/scorer.h
parentca9b58716214148eeaeaa3076e1a1dc8f8bb5892 (diff)
Stream support for MIRA (part of realtime)
Diffstat (limited to 'mteval/scorer.h')
-rw-r--r--mteval/scorer.h26
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