diff options
author | zens <zens@1f5c12ca-751b-0410-a591-d2e778427230> | 2006-07-21 17:22:00 +0400 |
---|---|---|
committer | zens <zens@1f5c12ca-751b-0410-a591-d2e778427230> | 2006-07-21 17:22:00 +0400 |
commit | 325353b0f47eb332e159bf5eca6cce13f65d8865 (patch) | |
tree | 4d3567fa291f6b01052c332b614dbb5819ef222b /misc | |
parent | c428ccd576091bcc9a1afb58066172913274d69b (diff) |
- support for binary ttable in moses almost completed
- moved common part of CreateTranslationOptionCollection() for text and confusion net input
to base class
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@237 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'misc')
-rw-r--r-- | misc/Makefile | 10 | ||||
-rw-r--r-- | misc/processPhraseTable.cpp | 9 |
2 files changed, 13 insertions, 6 deletions
diff --git a/misc/Makefile b/misc/Makefile index e70c1e010..bfe173fcf 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -1,8 +1,12 @@ + +BOOSTDIR=/home/ws06/cdyer/boost-stage CXX=g++ -CXXFLAGS=-W -Wall -O0 -g -ggdb -ffor-scope +CXXFLAGS=-W -Wall -O0 -g -ggdb -ffor-scope -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES LDFLAGS=-static -INCLUDES=-I../moses/src +INCLUDES=-I../moses/src -I$(BOOSTDIR) -I$(BOOSTDIR)/include +LIBS=-L$(BOOSTDIR)/lib -L$(BOOSTDIR)/stage/lib -lboost_iostreams-gcc-mt -lboost_filesystem-gcc-mt -lboost_thread-gcc-mt -lz + default: processPhraseTable @@ -12,7 +16,7 @@ processPhraseTable.o: processPhraseTable.cpp MOSESLIB =$(HOME)/workspace/moses/src/libmoses.a processPhraseTable: processPhraseTable.o $(MOSESLIB) - $(CXX) $(LDFLAGS) $^ -o $@ + $(CXX) $(LDFLAGS) $^ -o $@ $(LIBS) diff --git a/misc/processPhraseTable.cpp b/misc/processPhraseTable.cpp index 8bb057c05..ec5af4f99 100644 --- a/misc/processPhraseTable.cpp +++ b/misc/processPhraseTable.cpp @@ -1,5 +1,5 @@ #include <iostream> -#include <fstream> +//#include <fstream> #include <sstream> #include <vector> #include <string> @@ -11,6 +11,7 @@ #include "ConfusionNet.h" #include "FactorCollection.h" #include "Phrase.h" +#include "InputFileStream.h" template<typename T> std::ostream& operator<<(std::ostream& out,const std::vector<T>& x) @@ -46,6 +47,7 @@ inline bool existsFile(const std::string& filename) { int main(int argc,char **argv) { std::string fto;size_t noScoreComponent=5;int cn=0; std::vector<std::pair<std::string,std::pair<char*,char*> > > ftts; + int verb=0; for(int i=1;i<argc;++i) { std::string s(argv[i]); if(s=="-ttable") { @@ -58,6 +60,7 @@ int main(int argc,char **argv) { else if(s=="-out") fto=std::string(argv[++i]); else if(s=="-cn") cn=1; else if(s=="-irst") cn=2; + else if(s=="-v") verb=atoi(argv[++i]); else if(s=="-h") { std::cerr<<"usage "<<argv[0]<<" :\n\n" @@ -105,7 +108,7 @@ int main(int argc,char **argv) { std::string prefix=ftts[i].first+facStr; if(!existsFile(prefix+".binphr.idx")) { std::cerr<<"bin ttable does not exist -> create it\n"; - std::ifstream in(prefix.c_str()); + InputFileStream in(prefix); pdt.Create(in,prefix); } std::cerr<<"reading bin ttable\n"; @@ -173,7 +176,7 @@ int main(int argc,char **argv) { while(net.Read(std::cin,factorOrder,cn-1)) { net.Print(std::cerr); - GenerateCandidates(net,pdicts,weights); + GenerateCandidates(net,pdicts,weights,verb); } } |