diff options
author | Nicola Bertoldi <bertoldi@fbk.eu> | 2014-12-13 14:52:47 +0300 |
---|---|---|
committer | Nicola Bertoldi <bertoldi@fbk.eu> | 2014-12-13 14:52:47 +0300 |
commit | e4eb201c52be74fee74399a6f35fcbe8eb85d834 (patch) | |
tree | 7792ef96d63262f6e28f1857741e1162c7dccbc4 /phrase-extract/relax-parse-main.cpp | |
parent | cea2d9d8bb34a81660974cae20d66aefec4e0468 (diff) | |
parent | a0b6b6a341e74b47bbef4652ad7fd928cf91e17c (diff) |
merged master into dynamic-models and solved conflicts
Diffstat (limited to 'phrase-extract/relax-parse-main.cpp')
-rw-r--r-- | phrase-extract/relax-parse-main.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/phrase-extract/relax-parse-main.cpp b/phrase-extract/relax-parse-main.cpp index d3cb4c527..8188d70ec 100644 --- a/phrase-extract/relax-parse-main.cpp +++ b/phrase-extract/relax-parse-main.cpp @@ -20,8 +20,6 @@ ***********************************************************************/ #include "relax-parse.h" - -#include "SafeGetline.h" #include "tables-core.h" using namespace std; @@ -33,19 +31,15 @@ int main(int argc, char* argv[]) // loop through all sentences int i=0; - char inBuffer[LINE_MAX_LENGTH]; - while(true) { + string inBufferString; + while(cin.peek() != EOF) { + getline(cin,inBufferString); i++; if (i%1000 == 0) cerr << "." << flush; if (i%10000 == 0) cerr << ":" << flush; if (i%100000 == 0) cerr << "!" << flush; - // get line from stdin - SAFE_GETLINE( cin, inBuffer, LINE_MAX_LENGTH, '\n', __FILE__); - if (cin.eof()) break; - // process into syntax tree representation - string inBufferString = string( inBuffer ); set< string > labelCollection; // set of labels, not used map< string, int > topLabelCollection; // count of top labels, not used SyntaxTree tree; @@ -83,7 +77,7 @@ void init(int argc, char* argv[]) if (argc < 2) { cerr << "syntax: relax-parse < in-parse > out-parse [" - << " --LeftBinarize | ---RightBinarize |" + << " --LeftBinarize | --RightBinarize |" << " --SAMT 1-4 ]" << endl; exit(1); } |