From 46d6e1fd3dbe0bc116a46fdab91b40fe2ecd6803 Mon Sep 17 00:00:00 2001 From: redpony Date: Mon, 20 Sep 2010 18:50:30 +0000 Subject: support turning off verbose logging git-svn-id: https://ws10smt.googlecode.com/svn/trunk@652 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/scfg_translator.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'decoder/scfg_translator.cc') diff --git a/decoder/scfg_translator.cc b/decoder/scfg_translator.cc index 08276c71..4e6cc226 100644 --- a/decoder/scfg_translator.cc +++ b/decoder/scfg_translator.cc @@ -14,6 +14,7 @@ #include "sentence_metadata.h" #include "tdict.h" #include "viterbi.h" +#include "verbose.h" #define foreach BOOST_FOREACH #define reverse_foreach BOOST_REVERSE_FOREACH @@ -100,7 +101,7 @@ struct SCFGTranslatorImpl { LatticeTools::ConvertTextOrPLF(input, &lattice); smeta->SetSourceLength(lattice.size()); if (add_pass_through_rules){ - cerr << "Adding pass through grammar" << endl; + if (!SILENT) cerr << "Adding pass through grammar" << endl; PassThroughGrammar* g = new PassThroughGrammar(lattice, default_nt, ctf_iterations_); g->SetGrammarName("PassThrough"); glist.push_back(GrammarPtr(g)); @@ -109,13 +110,13 @@ struct SCFGTranslatorImpl { if(printGrammarsUsed) cerr << "Using grammar::" << glist[gi]->GetGrammarName() << endl; } - cerr << "First pass parse... " << endl; + if (!SILENT) cerr << "First pass parse... " << endl; ExhaustiveBottomUpParser parser(goal, glist); if (!parser.Parse(lattice, forest)){ - cerr << "parse failed." << endl; + if (!SILENT) cerr << "parse failed." << endl; return false; } else { - cerr << "parse succeeded." << endl; + if (!SILENT) cerr << "parse succeeded." << endl; } forest->Reweight(weights); if (use_ctf_) { -- cgit v1.2.3