From 125e9a8569037bb1d7a0613bc5dde7cd370bf2c8 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Sat, 5 Oct 2013 10:48:01 +0100 Subject: add debug argument --- phrase-extract/extract-main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'phrase-extract/extract-main.cpp') diff --git a/phrase-extract/extract-main.cpp b/phrase-extract/extract-main.cpp index 0b21eb19a..49e01a50c 100644 --- a/phrase-extract/extract-main.cpp +++ b/phrase-extract/extract-main.cpp @@ -170,6 +170,8 @@ int main(int argc, char* argv[]) exit(1); } options.initInstanceWeightsFile(argv[++i]); + } else if (strcmp(argv[i], "--Debug") == 0) { + options.debug = true; } else if(strcmp(argv[i],"--model") == 0) { if (i+1 >= argc) { cerr << "extract: syntax error, no model's information provided to the option --model " << endl; @@ -719,6 +721,12 @@ void ExtractTask::addPhrase( SentenceAlignment &sentence, int startE, int endE, return; } + if (m_options.debug) { + outextractstr << "sentenceID=" << sentence.sentenceID << " "; + outextractstrInv << "sentenceID=" << sentence.sentenceID << " "; + outextractstrOrientation << "sentenceID=" << sentence.sentenceID << " "; + } + for(int fi=startF; fi<=endF; fi++) { if (m_options.isTranslationFlag()) outextractstr << sentence.source[fi] << " "; if (m_options.isOrientationFlag()) outextractstrOrientation << sentence.source[fi] << " "; -- cgit v1.2.3