commit 2d3e4feca821218606d23fed3f97dadafa030ea9 Author: aboelhamd Date: Sat Jun 29 03:16:39 2019 +0200 Code is compatible with g++-5 now diff --git a/src/RulesApplier.cpp b/src/RulesApplier.cpp index 692ddfb..be95807 100644 --- a/src/RulesApplier.cpp +++ b/src/RulesApplier.cpp @@ -101,9 +101,7 @@ int main(int argc, char **argv) { ifstream lextorFile(lextorFilePath.c_str()); ofstream chunkerFile(chunkerFilePath.c_str()); - ofstream newLextorFile; - if (!newLextorFilePath.empty()) - newLextorFile = ofstream(newLextorFilePath.c_str()); + ofstream newLextorFile(newLextorFilePath.c_str()); if (lextorFile.is_open() && chunkerFile.is_open() && (newLextorFilePath.empty() || newLextorFile.is_open())) { // load transfer file in an xml document object @@ -135,9 +133,9 @@ int main(int argc, char **argv) { // write to new lextor file newLextorFile << tokenizedSentence << endl; -// cout << i++ << endl; + // cout << i++ << endl; -// spaces after each token + // spaces after each token vector spaces; // tokens in the sentence order diff --git a/src/YasmetFormatter.cpp b/src/YasmetFormatter.cpp index 662fd3f..9f47601 100644 --- a/src/YasmetFormatter.cpp +++ b/src/YasmetFormatter.cpp @@ -98,9 +98,7 @@ int main(int argc, char **argv) { ifstream lextorFile(lextorFilePath.c_str()); ifstream weightOutFile(weightsFilePath.c_str()); - ifstream targetFile; - if (!targetFilePath.empty()) - targetFile = ifstream(targetFilePath.c_str()); + ifstream targetFile(targetFilePath.c_str()); if (lextorFile.is_open() && weightOutFile.is_open() && (targetFilePath.empty() || targetFile.is_open())) { // load transfer file in an xml document object