diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2013-10-05 13:48:01 +0400 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2013-10-05 13:48:01 +0400 |
commit | 125e9a8569037bb1d7a0613bc5dde7cd370bf2c8 (patch) | |
tree | 7dd548e98f22956a401c96cab60b980f535fb6de | |
parent | 902741681a4979ef4f0d55ee265d1be3fe519ecc (diff) |
add debug argument
-rw-r--r-- | phrase-extract/PhraseExtractionOptions.h | 5 | ||||
-rw-r--r-- | phrase-extract/extract-main.cpp | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/phrase-extract/PhraseExtractionOptions.h b/phrase-extract/PhraseExtractionOptions.h index d70c2a117..574b9afc1 100644 --- a/phrase-extract/PhraseExtractionOptions.h +++ b/phrase-extract/PhraseExtractionOptions.h @@ -52,6 +52,7 @@ private: public: std::vector<std::string> placeholders; + bool debug; PhraseExtractionOptions(const int initmaxPhraseLength): maxPhraseLength(initmaxPhraseLength), @@ -67,7 +68,9 @@ public: includeSentenceIdFlag(false), onlyOutputSpanInfo(false), gzOutput(false), - flexScoreFlag(false) {} + flexScoreFlag(false), + debug(false) +{} //functions for initialization of options void initAllModelsOutputFlag(const bool initallModelsOutputFlag) { 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] << " "; |