summaryrefslogtreecommitdiff
path: root/decoder/apply_models.cc
diff options
context:
space:
mode:
authorredpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-09-20 18:50:30 +0000
committerredpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-09-20 18:50:30 +0000
commit46d6e1fd3dbe0bc116a46fdab91b40fe2ecd6803 (patch)
tree9caca4c1878a58b183e214ecf4caa225987bc8e7 /decoder/apply_models.cc
parentcf36f7d66ad19331da109f5a81ea3ea5844deb1c (diff)
support turning off verbose logging
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@652 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/apply_models.cc')
-rw-r--r--decoder/apply_models.cc21
1 files changed, 12 insertions, 9 deletions
diff --git a/decoder/apply_models.cc b/decoder/apply_models.cc
index 60b6f498..aec31a4f 100644
--- a/decoder/apply_models.cc
+++ b/decoder/apply_models.cc
@@ -13,6 +13,7 @@
#include <boost/functional/hash.hpp>
+#include "verbose.h"
#include "hg.h"
#include "ff.h"
@@ -170,7 +171,7 @@ public:
out(*o),
D(in.nodes_.size()),
pop_limit_(pop_limit) {
- cerr << " Applying feature functions (cube pruning, pop_limit = " << pop_limit_ << ')' << endl;
+ if (!SILENT) cerr << " Applying feature functions (cube pruning, pop_limit = " << pop_limit_ << ')' << endl;
node_states_.reserve(kRESERVE_NUM_NODES);
}
@@ -181,14 +182,16 @@ public:
int every = 1;
if (num_nodes > 100) every = 10;
assert(in.nodes_[pregoal].out_edges_.size() == 1);
- cerr << " ";
+ if (!SILENT) cerr << " ";
for (int i = 0; i < in.nodes_.size(); ++i) {
- if (i % every == 0) cerr << '.';
+ if (!SILENT && i % every == 0) cerr << '.';
KBest(i, i == goal_id);
}
- cerr << endl;
- cerr << " Best path: " << log(D[goal_id].front()->vit_prob_)
- << "\t" << log(D[goal_id].front()->est_prob_) << endl;
+ if (!SILENT) {
+ cerr << endl;
+ cerr << " Best path: " << log(D[goal_id].front()->vit_prob_)
+ << "\t" << log(D[goal_id].front()->est_prob_) << endl;
+ }
out.PruneUnreachable(D[goal_id].front()->node_index_);
FreeAll();
}
@@ -379,12 +382,12 @@ struct NoPruningRescorer {
int every = 1;
if (num_nodes > 100) every = 10;
assert(in.nodes_[pregoal].out_edges_.size() == 1);
- cerr << " ";
+ if (!SILENT) cerr << " ";
for (int i = 0; i < in.nodes_.size(); ++i) {
- if (i % every == 0) cerr << '.';
+ if (!SILENT && i % every == 0) cerr << '.';
ProcessOneNode(i, i == goal_id);
}
- cerr << endl;
+ if (!SILENT) cerr << endl;
}
private: