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 | eb0a8931eb835d8a23c939ef61867a08c19ebf6b (patch) | |
tree | 7112b6af490a04c8bfdc40eb88718702060823c7 /vest/fast_score.cc | |
parent | bcad98e114d468edf16369b3a30d98556a3d0e61 (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/fast_score.cc')
-rw-r--r-- | vest/fast_score.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/vest/fast_score.cc b/vest/fast_score.cc index 0d611d56..5ee264a6 100644 --- a/vest/fast_score.cc +++ b/vest/fast_score.cc @@ -41,7 +41,7 @@ int main(int argc, char** argv) { cerr << "Loaded " << ds.size() << " references for scoring with " << loss_function << endl; ReadFile rf(conf["in_file"].as<string>()); - Score* acc = NULL; + ScoreP acc; istream& in = *rf.stream(); int lc = 0; while(in) { @@ -50,10 +50,9 @@ int main(int argc, char** argv) { if (line.empty() && !in) break; vector<WordID> sent; TD::ConvertSentence(line, &sent); - Score* sentscore = ds[lc]->ScoreCandidate(sent); + ScoreP sentscore = ds[lc]->ScoreCandidate(sent); if (!acc) { acc = sentscore->GetZero(); } acc->PlusEquals(*sentscore); - delete sentscore; ++lc; } assert(lc > 0); @@ -67,7 +66,6 @@ int main(int argc, char** argv) { float score = acc->ComputeScore(); string details; acc->ScoreDetails(&details); - delete acc; cerr << details << endl; cout << score << endl; return 0; |