diff options
-rw-r--r-- | scripts/training/phrase-extract/Makefile | 4 | ||||
-rw-r--r-- | scripts/training/phrase-extract/extract-lex.cpp | 13 |
2 files changed, 9 insertions, 8 deletions
diff --git a/scripts/training/phrase-extract/Makefile b/scripts/training/phrase-extract/Makefile index 6c6b6a5f9..575f368dd 100644 --- a/scripts/training/phrase-extract/Makefile +++ b/scripts/training/phrase-extract/Makefile @@ -13,8 +13,8 @@ extract: tables-core.o SentenceAlignment.o extract.o extract-rules: tables-core.o SentenceAlignment.o SentenceAlignmentWithSyntax.o SyntaxTree.o XmlTree.o HoleCollection.o extract-rules.o ExtractedRule.o $(CXX) $^ -o extract-rules -extract-lex: extract-lex.o - $(CXX) $^ -o extract-lex +extract-lex: extract-lex.o InputFileStream.o + $(CXX) $^ -lz -o extract-lex score: tables-core.o AlignmentPhrase.o score.o PhraseAlignment.o InputFileStream.o $(CXX) $^ -lz -o score diff --git a/scripts/training/phrase-extract/extract-lex.cpp b/scripts/training/phrase-extract/extract-lex.cpp index f1e456d81..0be2b773a 100644 --- a/scripts/training/phrase-extract/extract-lex.cpp +++ b/scripts/training/phrase-extract/extract-lex.cpp @@ -3,6 +3,7 @@ #include <cassert> #include <vector> #include "extract-lex.h" +#include "InputFileStream.h" using namespace std; @@ -25,12 +26,9 @@ int main(int argc, char* argv[]) char* &filePathLexS2T = argv[4]; char* &filePathLexT2S = argv[5]; - ifstream streamTarget; - ifstream streamSource; - ifstream streamAlign; - streamTarget.open(filePathTarget); - streamSource.open(filePathSource); - streamAlign.open(filePathAlign); + Moses::InputFileStream streamTarget(filePathTarget); + Moses::InputFileStream streamSource(filePathSource); + Moses::InputFileStream streamAlign(filePathAlign); ofstream streamLexS2T; ofstream streamLexT2S; @@ -73,6 +71,9 @@ int main(int argc, char* argv[]) extractSingleton.Output(streamLexS2T, streamLexT2S); + streamTarget.Close(); + streamSource.Close(); + streamAlign.Close(); streamLexS2T.close(); streamLexT2S.close(); |