blob: 07823125c2f64b9fd2b43a0722f8371f13509066 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
// $Id$
#include <iostream>
#include <sstream>
#include "ScoreComponentCollection.h"
#include "ScoreProducer.h"
using namespace std;
namespace Moses
{
multiset<string> ScoreProducer::description_counts;
const size_t ScoreProducer::unlimited = -1;
ScoreProducer::ScoreProducer(const std::string& description, size_t numScoreComponents)
: m_reportSparseFeatures(false), m_numScoreComponents(numScoreComponents)
{
description_counts.insert(description);
size_t count = description_counts.count(description);
ostringstream dstream;
dstream << description;
if (count > 1)
{
dstream << ":" << count;
}
m_description = dstream.str();
if (numScoreComponents != unlimited)
{
ScoreComponentCollection::RegisterScoreProducer(this);
}
}
ScoreProducer::~ScoreProducer() {
}
}
|