diff options
author | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-20 00:11:45 +0000 |
---|---|---|
committer | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-20 00:11:45 +0000 |
commit | f28e6d45671035d39dcfc25070c72f6e120032e1 (patch) | |
tree | d3627fd7c440bae67b81f1578fea9576d4836603 /vest/scorer.h | |
parent | b6cf365f217bc7b528243071af733d4a251ff77c (diff) |
Score::TimesEquals for vlad-mira, intrusive refcount for Score, shared_ptr compile fixes for decoder progs
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@331 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'vest/scorer.h')
-rw-r--r-- | vest/scorer.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/vest/scorer.h b/vest/scorer.h index 29ba5377..0d90f378 100644 --- a/vest/scorer.h +++ b/vest/scorer.h @@ -5,21 +5,23 @@ #include <boost/shared_ptr.hpp> //TODO: use intrusive shared_ptr in Score (because there are many of them on ErrorSurfaces) #include "wordid.h" +#include "intrusive_refcount.hpp" class Score; class SentenceScorer; -typedef boost::shared_ptr<Score> ScoreP; +typedef boost::intrusive_ptr<Score> ScoreP; typedef boost::shared_ptr<SentenceScorer> ScorerP; class ViterbiEnvelope; class ErrorSurface; class Hypergraph; // needed for alignment +//TODO: BLEU N (N separate arg, not part of enum)? enum ScoreType { IBM_BLEU, NIST_BLEU, Koehn_BLEU, TER, BLEU_minus_TER_over_2, SER, AER, IBM_BLEU_3 }; ScoreType ScoreTypeFromString(const std::string& st); std::string StringFromScoreType(ScoreType st); -class Score { +class Score : public boost::intrusive_refcount<Score> { public: virtual ~Score(); virtual float ComputeScore() const = 0; @@ -30,6 +32,8 @@ class Score { ScoreDetails(&d); return d; } + virtual void TimesEquals(float scale); // only for bleu; for mira oracle + /// same as rhs.TimesEquals(scale);PlusEquals(rhs) except doesn't modify rhs. virtual void PlusEquals(const Score& rhs, const float scale) = 0; virtual void PlusEquals(const Score& rhs) = 0; virtual void PlusPartialEquals(const Score& rhs, int oracle_e_cover, int oracle_f_cover, int src_len) = 0; |