diff options
author | mjdenkowski <michael.j.denkowski@gmail.com> | 2013-12-29 17:16:43 -0500 |
---|---|---|
committer | mjdenkowski <michael.j.denkowski@gmail.com> | 2013-12-29 17:16:43 -0500 |
commit | 791301036d6bfa406c2d5222032b204f7d4943ee (patch) | |
tree | 0a76fdd52700ac43864be62124a43b4f2e940a8b /decoder/decoder.cc | |
parent | b12f48112213cbbde519b8aabd02b2c57bf0948d (diff) | |
parent | 3c22963a360346381588350962499d1a76a89c10 (diff) |
Merge branch 'master' of https://github.com/redpony/cdec
Diffstat (limited to 'decoder/decoder.cc')
-rw-r--r-- | decoder/decoder.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/decoder/decoder.cc b/decoder/decoder.cc index 9b41253b..5bb62710 100644 --- a/decoder/decoder.cc +++ b/decoder/decoder.cc @@ -387,6 +387,7 @@ DecoderImpl::DecoderImpl(po::variables_map& conf, int argc, char** argv, istream ("show_partition,z", "Compute and show the partition (inside score)") ("show_conditional_prob", "Output the conditional log prob to STDOUT instead of a translation") ("show_cfg_search_space", "Show the search space as a CFG") + ("show_cfg_alignment_space", "Show the alignment hypergraph as a CFG") ("show_target_graph", po::value<string>(), "Directory to write the target hypergraphs to") ("incremental_search", po::value<string>(), "Run lazy search with this language model file") ("coarse_to_fine_beam_prune", po::value<double>(), "Prune paths from coarse parse forest before fine parse, keeping paths within exp(alpha>=0)") @@ -988,6 +989,8 @@ bool DecoderImpl::Decode(const string& input, DecoderObserver* o) { cerr << " Contst. partition log(Z): " << log(z) << endl; } o->NotifyAlignmentForest(smeta, &forest); + if (conf.count("show_cfg_alignment_space")) + HypergraphIO::WriteAsCFG(forest); if (conf.count("forest_output")) { ForestWriter writer(str("forest_output",conf), sent_id); if (FileExists(writer.fname_)) { |