From 1350b8e8e465acc9d4d8d43d807cc6093e8f37b9 Mon Sep 17 00:00:00 2001 From: "vladimir.eidelman" Date: Wed, 14 Jul 2010 23:00:08 +0000 Subject: Added oracle forest rescoring git-svn-id: https://ws10smt.googlecode.com/svn/trunk@254 ec762483-ff6d-05da-a07a-a48fb63a330f --- vest/ter.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'vest/ter.cc') 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(stats[kINSERTIONS] + stats[kDELETIONS] + stats[kSUBSTITUTIONS] + stats[kSHIFTS]); return edits / static_cast(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(delta).stats; + } void PlusEquals(const Score& delta) { stats += static_cast(delta).stats; } + Score* GetZero() const { return new TERScore; } + Score* GetOne() const { + return new TERScore; + } void Subtract(const Score& rhs, Score* res) const { static_cast(res)->stats = stats - static_cast(rhs).stats; } @@ -489,6 +498,11 @@ TERScorer::TERScorer(const vector >& refs) : impl_(refs.size()) { impl_[i] = new TERScorerImpl(refs[i]); } +Score* TERScorer::ScoreCCandidate(const vector& hyp) const { + Score* a = NULL; + return a; +} + Score* TERScorer::ScoreCandidate(const std::vector& hyp) const { float best_score = numeric_limits::max(); TERScore* res = new TERScore; -- cgit v1.2.3