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:
authornicolabertoldi <nicolabertoldi@1f5c12ca-751b-0410-a591-d2e778427230>2008-05-20 18:15:30 +0400
committernicolabertoldi <nicolabertoldi@1f5c12ca-751b-0410-a591-d2e778427230>2008-05-20 18:15:30 +0400
commit8a594fc254c520b62700b56fb14534be36394e06 (patch)
treeba2a8fa7eddbdf08a5b9cefff5b247094fc909cb /mert/ScoreArray.cpp
parentf30000b87575f969e1ef9ac87ef1eaccecb1ec4e (diff)
reading from textual gzipped file is now possible
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1786 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'mert/ScoreArray.cpp')
-rw-r--r--mert/ScoreArray.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/mert/ScoreArray.cpp b/mert/ScoreArray.cpp
index 6c57adf7f..2eb5361e4 100644
--- a/mert/ScoreArray.cpp
+++ b/mert/ScoreArray.cpp
@@ -67,10 +67,9 @@ void ScoreArray::loadtxt(ifstream& inFile)
TRACE_ERR("starting loadtxt..." << std::endl);
std::getline(inFile, stringBuf);
- if (stringBuf.empty()){
- TRACE_ERR("ERROR: Empty string" << std::endl);
+ if (!inFile.good()){
return;
- }
+ }
if (!stringBuf.empty()){
// TRACE_ERR("Reading: " << stringBuf << std::endl);
@@ -116,10 +115,11 @@ void ScoreArray::load(ifstream& inFile, bool bin)
void ScoreArray::load(const std::string &file , bool bin)
{
- TRACE_ERR("loading data from " << file << std::endl);
+ TRACE_ERR("loading data from " << file << std::endl);
+
+ inputfilestream inFile(file); // matches a stream with a file. Opens the file
- std::ifstream inFile(file.c_str(), std::ios::in); // matches a stream with a file. Opens the file
+ load((ifstream&) inFile, bin);
- load(inFile, bin);
inFile.close();
}