summaryrefslogtreecommitdiff
path: root/vest/fast_score.cc
diff options
context:
space:
mode:
authorgraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-20 00:11:45 +0000
committergraehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-20 00:11:45 +0000
commitf28e6d45671035d39dcfc25070c72f6e120032e1 (patch)
treed3627fd7c440bae67b81f1578fea9576d4836603 /vest/fast_score.cc
parentb6cf365f217bc7b528243071af733d4a251ff77c (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.cc6
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;