diff options
author | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-09-20 18:50:30 +0000 |
---|---|---|
committer | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-09-20 18:50:30 +0000 |
commit | e5625218ad4e0ea8216ad55125fc1099ccab0e19 (patch) | |
tree | 49b5615c144a6f119f1b19afa857e94b8b114311 /decoder/apply_models.cc | |
parent | 9392ebeb48efca4d9a8279eea62c0ffcb8fbbed4 (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.cc | 21 |
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: |