summaryrefslogtreecommitdiff
path: root/training/candidate_set.cc
diff options
context:
space:
mode:
authorPatrick Simianer <simianer@cl.uni-heidelberg.de>2012-07-08 14:26:51 +0200
committerPatrick Simianer <simianer@cl.uni-heidelberg.de>2012-07-08 14:26:51 +0200
commitc139ce495861bb341e1b86a85ad4559f9ad53c14 (patch)
tree1071839ee458f21f169ce06fc536fefe07e4c65d /training/candidate_set.cc
parent3a94ac22e5c60aa205f2b3dadf81b0666500e0c3 (diff)
parentd01e5b66d3010d61b9b56301fd7f302dd4ea5bc8 (diff)
Merge branch 'master' of github.com:pks/cdec-dtrain
Diffstat (limited to 'training/candidate_set.cc')
-rw-r--r--training/candidate_set.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/training/candidate_set.cc b/training/candidate_set.cc
index 8c086ece..087efec3 100644
--- a/training/candidate_set.cc
+++ b/training/candidate_set.cc
@@ -4,6 +4,7 @@
#include <boost/functional/hash.hpp>
+#include "verbose.h"
#include "ns.h"
#include "filelib.h"
#include "wordid.h"
@@ -118,7 +119,7 @@ void CandidateSet::WriteToFile(const string& file) const {
}
void CandidateSet::ReadFromFile(const string& file) {
- cerr << "Reading candidates from " << file << endl;
+ if(!SILENT) cerr << "Reading candidates from " << file << endl;
ReadFile rf(file);
istream& in = *rf.stream();
string cand;
@@ -133,11 +134,11 @@ void CandidateSet::ReadFromFile(const string& file) {
ParseSparseVector(feats, 0, &cs.back().fmap);
cs.back().eval_feats = SufficientStats(ss);
}
- cerr << " read " << cs.size() << " candidates\n";
+ if(!SILENT) cerr << " read " << cs.size() << " candidates\n";
}
void CandidateSet::Dedup() {
- cerr << "Dedup in=" << cs.size();
+ if(!SILENT) cerr << "Dedup in=" << cs.size();
tr1::unordered_set<Candidate, CandidateHasher, CandidateCompare> u;
while(cs.size() > 0) {
u.insert(cs.back());
@@ -148,7 +149,7 @@ void CandidateSet::Dedup() {
cs.push_back(*it);
it = u.erase(it);
}
- cerr << " out=" << cs.size() << endl;
+ if(!SILENT) cerr << " out=" << cs.size() << endl;
}
void CandidateSet::AddKBestCandidates(const Hypergraph& hg, size_t kbest_size, const SegmentEvaluator* scorer) {