diff options
Diffstat (limited to 'vest/ter.cc')
-rw-r--r-- | vest/ter.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vest/ter.cc b/vest/ter.cc index ef66f3b7..6e16e1cf 100644 --- a/vest/ter.cc +++ b/vest/ter.cc @@ -424,17 +424,26 @@ class TERScore : public Score { static const unsigned kDUMMY_LAST_ENTRY = 5; TERScore() : stats(0,kDUMMY_LAST_ENTRY) {} + float ComputePartialScore() const { return 0.0;} float ComputeScore() const { float edits = static_cast<float>(stats[kINSERTIONS] + stats[kDELETIONS] + stats[kSUBSTITUTIONS] + stats[kSHIFTS]); return edits / static_cast<float>(stats[kREF_WORDCOUNT]); } void ScoreDetails(string* details) const; + void PlusPartialEquals(const Score& rhs, int oracle_e_cover, int oracle_f_cover, int src_len){} + void PlusEquals(const Score& delta, const float scale) { + stats += static_cast<const TERScore&>(delta).stats; + } void PlusEquals(const Score& delta) { stats += static_cast<const TERScore&>(delta).stats; } + Score* GetZero() const { return new TERScore; } + Score* GetOne() const { + return new TERScore; + } void Subtract(const Score& rhs, Score* res) const { static_cast<TERScore*>(res)->stats = stats - static_cast<const TERScore&>(rhs).stats; } @@ -489,6 +498,11 @@ TERScorer::TERScorer(const vector<vector<WordID> >& refs) : impl_(refs.size()) { impl_[i] = new TERScorerImpl(refs[i]); } +Score* TERScorer::ScoreCCandidate(const vector<WordID>& hyp) const { + Score* a = NULL; + return a; +} + Score* TERScorer::ScoreCandidate(const std::vector<WordID>& hyp) const { float best_score = numeric_limits<float>::max(); TERScore* res = new TERScore; |