diff options
author | Hieu Hoang <hieu@hoang.co.uk> | 2014-06-08 19:23:14 +0400 |
---|---|---|
committer | Hieu Hoang <hieu@hoang.co.uk> | 2014-06-08 19:23:14 +0400 |
commit | cb94a3181bd00c74bf0b2b81fea4aee2195dc121 (patch) | |
tree | 3bedb39ba6be32a408583c965ace9e68f23861a0 /phrase-extract/relax-parse-main.cpp | |
parent | 23ba0de2247e84db69759445a41c4c4f04840460 (diff) |
use standard c++ getline instead of old Moses SAFE_GETLINE
Diffstat (limited to 'phrase-extract/relax-parse-main.cpp')
-rw-r--r-- | phrase-extract/relax-parse-main.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/phrase-extract/relax-parse-main.cpp b/phrase-extract/relax-parse-main.cpp index a58d4d97f..c04cae85b 100644 --- a/phrase-extract/relax-parse-main.cpp +++ b/phrase-extract/relax-parse-main.cpp @@ -33,17 +33,13 @@ int main(int argc, char* argv[]) // loop through all sentences int i=0; - char inBuffer[LINE_MAX_LENGTH]; - while(true) { + string inBuffer; + while(getline(cin, inBuffer)) { 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 |