From 3e8f5cd6191b700df08867e3eb0b8c03d2324fe3 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Mon, 10 Oct 2011 22:39:41 +0200 Subject: speed --- dtrain/dtrain.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'dtrain/dtrain.cc') diff --git a/dtrain/dtrain.cc b/dtrain/dtrain.cc index 69f83633..5d84f250 100644 --- a/dtrain/dtrain.cc +++ b/dtrain/dtrain.cc @@ -241,7 +241,7 @@ main(int argc, char** argv) vector ref_ids; // reference as vector if (t == 0) { // handling input - boost::split(in_split, in, boost::is_any_of("\t")); + split_in(in, in_split); // getting reference vector ref_tok; boost::split(ref_tok, in_split[2], boost::is_any_of(" ")); @@ -249,17 +249,17 @@ main(int argc, char** argv) ref_ids_buf.push_back(ref_ids); // process and set grammar bool broken_grammar = true; - for (string::iterator it = in_split[3].begin(); it != in_split[3].end(); it++) { + for (string::iterator it = in.begin(); it != in.end(); it++) { if (!isspace(*it)) { broken_grammar = false; break; } } if (broken_grammar) continue; - boost::replace_all(in_split[3], " __NEXT__RULE__ ", "\n"); // TODO - in_split[3] += "\n"; - grammar_buf_out << in_split[3] << DTRAIN_GRAMMAR_DELIM << " " << in_split[0] << endl; - decoder.SetSentenceGrammarFromString(in_split[3]); + boost::replace_all(in, "\t", "\n"); + in += "\n"; + grammar_buf_out << in << DTRAIN_GRAMMAR_DELIM << " " << in_split[0] << endl; + decoder.SetSentenceGrammarFromString(in); src_str_buf.push_back(in_split[1]); // decode observer->SetRef(ref_ids); -- cgit v1.2.3