summaryrefslogtreecommitdiff
path: root/decoder/scfg_translator.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/scfg_translator.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/scfg_translator.cc')
-rw-r--r--decoder/scfg_translator.cc9
1 files changed, 5 insertions, 4 deletions
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_) {