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:
authorhieuhoang1972 <hieuhoang1972@1f5c12ca-751b-0410-a591-d2e778427230>2011-10-11 10:49:19 +0400
committerhieuhoang1972 <hieuhoang1972@1f5c12ca-751b-0410-a591-d2e778427230>2011-10-11 10:49:19 +0400
commitea4db804731da9e315441f3343053afff76dc66d (patch)
treea6cf8db0802ef1490abd8c2965d83547b476146c /scripts
parent8f0c841d281368d1df5a0a316d6f4d0ea68c1291 (diff)
extract lex probability from gzip files
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@4321 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'scripts')
-rw-r--r--scripts/training/phrase-extract/Makefile4
-rw-r--r--scripts/training/phrase-extract/extract-lex.cpp13
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();