From 5368e9dda4edf813618f3d5179973ff6a3c11b7a Mon Sep 17 00:00:00 2001 From: graehl Date: Wed, 11 Aug 2010 01:34:57 +0000 Subject: debug cfg from hg, source and target. cdec --source_cfg_output=- git-svn-id: https://ws10smt.googlecode.com/svn/trunk@507 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/cfg_options.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'decoder/cfg_options.h') diff --git a/decoder/cfg_options.h b/decoder/cfg_options.h index cbbe3b42..956586f0 100755 --- a/decoder/cfg_options.h +++ b/decoder/cfg_options.h @@ -9,7 +9,7 @@ struct CFGOptions { CFGFormat format; CFGBinarize binarize; - std::string cfg_output; + std::string cfg_output,source_cfg_output; void set_defaults() { format.set_defaults(); binarize.set_defaults(); @@ -19,7 +19,8 @@ struct CFGOptions { template // template to support both printable_opts and boost nonprintable void AddOptions(Opts *opts) { opts->add_options() - ("cfg_output", defaulted_value(&cfg_output),"write final target CFG (before FSA rescorinn) to this file") + ("cfg_output", defaulted_value(&cfg_output),"write final target CFG (before FSA rescoring) to this file") + ("source_cfg_output", defaulted_value(&source_cfg_output),"write source CFG (after prelm-scoring, prelm-prune) to this file") ; binarize.AddOptions(opts); format.AddOptions(opts); @@ -31,9 +32,16 @@ struct CFGOptions { char const* description() const { return "CFG output options"; } + void maybe_output_source(Hypergraph const& hg) { + if (source_cfg_output.empty()) return; + std::cerr<<"Printing source CFG to "<