From c9416968b391f10891733a00cc57bda27b4d323d Mon Sep 17 00:00:00 2001 From: graehl Date: Wed, 21 Jul 2010 21:04:04 +0000 Subject: verbose() instead of redundant flag git-svn-id: https://ws10smt.googlecode.com/svn/trunk@363 ec762483-ff6d-05da-a07a-a48fb63a330f --- vest/dist-vest.pl | 1 + vest/mr_vest_generate_mapper_input.cc | 19 +++++++++---------- vest/scorer.cc | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'vest') diff --git a/vest/dist-vest.pl b/vest/dist-vest.pl index c9c11d23..97b72f45 100755 --- a/vest/dist-vest.pl +++ b/vest/dist-vest.pl @@ -75,6 +75,7 @@ if (GetOptions( "normalize=s" => \$normalize, "pmem=s" => \$pmem, "rand-directions=i" => \$rand_directions, + "random_directions=i" => \$rand_directions, "no-primary!" => \$noprimary, "max-similarity=s" => \$maxsim, "oracle-directions=i" => \$oraclen, diff --git a/vest/mr_vest_generate_mapper_input.cc b/vest/mr_vest_generate_mapper_input.cc index 5ab5c689..f1179839 100644 --- a/vest/mr_vest_generate_mapper_input.cc +++ b/vest/mr_vest_generate_mapper_input.cc @@ -132,7 +132,6 @@ struct oracle_directions { } UseConf(*conf); - verbose=oracle.verbose; return; bad_cmdline: cerr << dcmdline_options << endl; @@ -145,11 +144,11 @@ struct oracle_directions { Run(); return 0; } - bool verbose; + bool verbose() const { return oracle.verbose; } void Run() { AddPrimaryAndRandomDirections(); AddOracleDirections(); - compress_similar(directions,max_similarity,&cerr,true,verbose); + compress_similar(directions,max_similarity,&cerr,true,verbose()); Print(); } @@ -189,7 +188,7 @@ struct oracle_directions { have_doc=!decoder_translations_file.empty(); if (have_doc) { model_hyps.Load(decoder_translations_file); - if (verbose) model_hyps.Print(cerr,5); + if (verbose()) model_hyps.Print(cerr,5); model_scores.resize(model_hyps.size()); if (dev_set_size!=model_hyps.size()) { cerr<<"You supplied decoder_translations with a different number of lines ("<ScoreCandidate(model_hyps[i]); assert(model_scores[i]); - if (verbose) cerr<<"Before model["<ScoreDetails()<ScoreDetails()<PlusEquals(*model_scores[i]); - if (verbose) cerr<<"After model["<PlusEquals(*hopesc,1); diff --git a/vest/scorer.cc b/vest/scorer.cc index 5671de38..70fdef34 100644 --- a/vest/scorer.cc +++ b/vest/scorer.cc @@ -483,7 +483,7 @@ void SentenceScorer::ComputeErrorSurface(const ViterbiEnvelope& ve, ErrorSurface void BLEUScore::ScoreDetails(string* details) const { char buf[2000]; - vector precs(min(N(),4)); + vector precs(max(N(),4)); float bp; float bleu = ComputeScore(&precs, &bp); for (int i=N();i<4;++i) -- cgit v1.2.3