From 3ec30b72f47e063d94648a9823653e6ec3e17401 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Sun, 23 Feb 2014 02:13:32 -0500 Subject: fix rule emission behavior --- decoder/decoder.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/decoder/decoder.cc b/decoder/decoder.cc index e02c7730..f8104c5e 100644 --- a/decoder/decoder.cc +++ b/decoder/decoder.cc @@ -662,11 +662,6 @@ DecoderImpl::DecoderImpl(po::variables_map& conf, int argc, char** argv, istream oracle.show_derivation=conf.count("show_derivations"); remove_intersected_rule_annotations = conf.count("remove_intersected_rule_annotations"); - if (conf.count("extract_rules")) { - stringstream ss; - ss << sent_id; - extract_file.reset(new WriteFile(str("extract_rules",conf)+"/"+ss.str())); - } combine_size = conf["combine_size"].as(); if (combine_size < 1) combine_size = 1; sent_id = -1; @@ -720,6 +715,11 @@ bool DecoderImpl::Decode(const string& input, DecoderObserver* o) { } cerr << " id = " << sent_id << endl; } + if (conf.count("extract_rules")) { + stringstream ss; + ss << sent_id << ".gz"; + extract_file.reset(new WriteFile(str("extract_rules",conf)+"/"+ss.str())); + } string to_translate; Lattice ref; ParseTranslatorInputLattice(buf, &to_translate, &ref); -- cgit v1.2.3