summaryrefslogtreecommitdiff
path: root/decoder/decoder.cc
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2012-06-05 15:47:09 -0400
committerChris Dyer <cdyer@cs.cmu.edu>2012-06-05 15:47:09 -0400
commit6d95c0b1edea38a972c287793fabae8f7f0eea1a (patch)
treea70c0aaddf6e3313ebe349b6a90542ab5359b3be /decoder/decoder.cc
parent76950778554a836230b68aa1ba517bc19521a66f (diff)
parent57d8aeaf862bad8516e8aa87eca10fdb75bdcb3a (diff)
Merge branch 'master' of github.com:redpony/cdec
Diffstat (limited to 'decoder/decoder.cc')
-rw-r--r--decoder/decoder.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/decoder/decoder.cc b/decoder/decoder.cc
index 487c7635..cbb97a0d 100644
--- a/decoder/decoder.cc
+++ b/decoder/decoder.cc
@@ -122,13 +122,16 @@ inline bool store_conf(po::variables_map const& conf,std::string const& name,V *
inline boost::shared_ptr<FeatureFunction> make_ff(string const& ffp,bool verbose_feature_functions,char const* pre="") {
string ff, param;
SplitCommandAndParam(ffp, &ff, &param);
- cerr << pre << "feature: " << ff;
- if (param.size() > 0) cerr << " (with config parameters '" << param << "')\n";
- else cerr << " (no config parameters)\n";
+ if (verbose_feature_functions && !SILENT)
+ cerr << pre << "feature: " << ff;
+ if (!SILENT) {
+ if (param.size() > 0) cerr << " (with config parameters '" << param << "')\n";
+ else cerr << " (no config parameters)\n";
+ }
boost::shared_ptr<FeatureFunction> pf = ff_registry.Create(ff, param);
if (!pf) exit(1);
int nbyte=pf->NumBytesContext();
- if (verbose_feature_functions)
+ if (verbose_feature_functions && !SILENT)
cerr<<"State is "<<nbyte<<" bytes for "<<pre<<"feature "<<ffp<<endl;
return pf;
}
@@ -142,7 +145,7 @@ inline boost::shared_ptr<FsaFeatureFunction> make_fsa_ff(string const& ffp,bool
else cerr << " (no config parameters)\n";
boost::shared_ptr<FsaFeatureFunction> pf = fsa_ff_registry.Create(ff, param);
if (!pf) exit(1);
- if (verbose_feature_functions)
+ if (verbose_feature_functions && !SILENT)
cerr<<"State is "<<pf->state_bytes()<<" bytes for "<<pre<<"feature "<<ffp<<endl;
return pf;
}
@@ -211,8 +214,10 @@ struct DecoderImpl {
}
forest.PruneInsideOutside(beam_prune,density_prune,pm,false,1);
if (!forestname.empty()) forestname=" "+forestname;
- forest_stats(forest," Pruned "+forestname+" forest",false,false);
- cerr << " Pruned "<<forestname<<" forest portion of edges kept: "<<forest.edges_.size()/presize<<endl;
+ if (!SILENT) {
+ forest_stats(forest," Pruned "+forestname+" forest",false,false);
+ cerr << " Pruned "<<forestname<<" forest portion of edges kept: "<<forest.edges_.size()/presize<<endl;
+ }
}
}