Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieu@hoang.co.uk>2014-06-08 19:23:14 +0400
committerHieu Hoang <hieu@hoang.co.uk>2014-06-08 19:23:14 +0400
commitcb94a3181bd00c74bf0b2b81fea4aee2195dc121 (patch)
tree3bedb39ba6be32a408583c965ace9e68f23861a0 /phrase-extract/consolidate-direct-main.cpp
parent23ba0de2247e84db69759445a41c4c4f04840460 (diff)
use standard c++ getline instead of old Moses SAFE_GETLINE
Diffstat (limited to 'phrase-extract/consolidate-direct-main.cpp')
-rw-r--r--phrase-extract/consolidate-direct-main.cpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/phrase-extract/consolidate-direct-main.cpp b/phrase-extract/consolidate-direct-main.cpp
index 3b38f741c..40e0e35d4 100644
--- a/phrase-extract/consolidate-direct-main.cpp
+++ b/phrase-extract/consolidate-direct-main.cpp
@@ -26,16 +26,9 @@
#include "InputFileStream.h"
#include "OutputFileStream.h"
-#include "SafeGetline.h"
-
-#define LINE_MAX_LENGTH 10000
-
using namespace std;
-char line[LINE_MAX_LENGTH];
-
-
-vector< string > splitLine()
+vector< string > splitLine(const char *line)
{
vector< string > item;
int start=0;
@@ -61,14 +54,15 @@ bool getLine( istream &fileP, vector< string > &item )
{
if (fileP.eof())
return false;
-
- SAFE_GETLINE((fileP), line, LINE_MAX_LENGTH, '\n', __FILE__);
- if (fileP.eof())
+
+ string line;
+ if (getline(fileP, line)) {
+ item = splitLine(line.c_str());
return false;
-
- item = splitLine();
-
- return true;
+ }
+ else {
+ return false;
+ }
}