- binary phrase table now fully supported

-> define preprocessor variable USEBINTTABLE
      e.g. uncommenting the line in StaticData.cpp
           or on the make  command line
 - some clean up


git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@241 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
zens 2006-07-21 13:50:41 +00:00
parent 4c03fc1de8
commit c220c86501
8 changed files with 15 additions and 30 deletions

View File

@ -97,13 +97,10 @@ int main(int argc, char* argv[])
return EXIT_FAILURE;
// read each sentence & decode
InputType *source;
//staticData.GetInputType()
while( (source = inputOutput->GetInput()) != NULL)
while(InputType *source = inputOutput->GetInput())
{
if(Sentence* sent=dynamic_cast<Sentence*>(source))
TRACE_ERR(*sent << endl);
TranslationOptionCollection * translationOptionCollection=CreateTranslationOptionCollection(source);
if(Sentence* sent=dynamic_cast<Sentence*>(source)) TRACE_ERR(*sent<<"\n");
TranslationOptionCollection *translationOptionCollection=CreateTranslationOptionCollection(source);
assert(translationOptionCollection);
Manager manager(*source, *translationOptionCollection, staticData);

View File

@ -57,8 +57,6 @@ am__moses_SOURCES_DIST = Main.cpp IOCommandLine.cpp IOFile.cpp \
am_moses_OBJECTS = Main.$(OBJEXT) IOCommandLine.$(OBJEXT) \
IOFile.$(OBJEXT) $(am__objects_1)
moses_OBJECTS = $(am_moses_OBJECTS)
am__DEPENDENCIES_1 =
moses_DEPENDENCIES = $(am__DEPENDENCIES_1)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@ -155,13 +153,9 @@ sharedstatedir = ${prefix}/com
sysconfdir = ${prefix}/etc
target_alias =
moses_SOURCES = Main.cpp IOCommandLine.cpp IOFile.cpp $(am__append_1)
MOSESLIB = -lmoses
processPhraseTable_SOURCES = processPhraseTable.cpp
processPhraseTable_LDADD = $(MOSESLIB)
# this really needs to be fixed
### INCLUDES = -I../../src
moses_LDADD = $(MOSESLIB)
AM_CPPFLAGS = -W -Wall -ffor-scope -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES
moses_LDADD = -lmoses
moses_DEPENDENCIES = $(top_srcdir)/../moses/src/libmoses.a
all: all-am
.SUFFIXES:

View File

@ -57,8 +57,6 @@ am__moses_SOURCES_DIST = Main.cpp IOCommandLine.cpp IOFile.cpp \
am_moses_OBJECTS = Main.$(OBJEXT) IOCommandLine.$(OBJEXT) \
IOFile.$(OBJEXT) $(am__objects_1)
moses_OBJECTS = $(am_moses_OBJECTS)
am__DEPENDENCIES_1 =
moses_DEPENDENCIES = $(am__DEPENDENCIES_1)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@ -155,13 +153,9 @@ sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
moses_SOURCES = Main.cpp IOCommandLine.cpp IOFile.cpp $(am__append_1)
MOSESLIB = -lmoses
processPhraseTable_SOURCES = processPhraseTable.cpp
processPhraseTable_LDADD = $(MOSESLIB)
# this really needs to be fixed
### INCLUDES = -I../../src
moses_LDADD = $(MOSESLIB)
AM_CPPFLAGS = -W -Wall -ffor-scope -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES
moses_LDADD = -lmoses
moses_DEPENDENCIES = $(top_srcdir)/../moses/src/libmoses.a
all: all-am
.SUFFIXES:

View File

@ -5,7 +5,7 @@
#include "Input.h"
#include "Sentence.h"
#include "WordsRange.h"
//#include "PhraseDictionaryTreeAdaptor.h"
#include "PhraseDictionaryTreeAdaptor.h"
TargetPhraseCollection const*
CreateTargetPhraseCollection(Dictionary const* d,
InputType const* i,
@ -15,8 +15,8 @@ CreateTargetPhraseCollection(Dictionary const* d,
Phrase src=s->GetSubString(r);
if(PhraseDictionary const* pdict=dynamic_cast<PhraseDictionary const*>(d))
return pdict->FindEquivPhrase(src);
// else if(PhraseDictionaryTreeAdaptor const* pdict=dynamic_cast<PhraseDictionaryTreeAdaptor const*>(d))
// return pdict->GetTargetPhraseCollection(src);
else if(PhraseDictionaryTreeAdaptor const* pdict=dynamic_cast<PhraseDictionaryTreeAdaptor const*>(d))
return pdict->GetTargetPhraseCollection(src);
else
std::cerr<<"ERROR: unknown phrase dictionary type in "<<__FILE__<<"\n";
}

View File

@ -15,7 +15,6 @@ TranslationOptionCollection* CreateTranslationOptionCollection(InputType const*
{
std::cerr<<"ERROR: unknown InputType in "<<__FILE__<<"\n";
abort();
return 0;
}
}

View File

@ -15,7 +15,6 @@ protected:
public:
InputType(long translationId=0);
//Input();
virtual ~InputType();
// for db stuff

View File

@ -63,6 +63,7 @@ Parameter::Parameter()
AddParam("stack");
AddParam("verbose");
AddParam("drop-unknown");
AddParam("inputtype");
}
// check if parameter settings make sense
@ -239,6 +240,7 @@ bool Parameter::LoadParam(int argc, char* argv[])
OverwriteParam("-s", "stack", argc, argv);
OverwriteParam("-v", "verbose", argc, argv);
OverwriteParam("-drop-unknown", "drop-unknown", argc, argv);
OverwriteParam("-inputtype","inputtype",argc,argv);
// check if parameters make sense
return Validate();
}

View File

@ -20,7 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
***********************************************************************/
#include <string>
#include <assert.h>
#include <cassert>
#include "StaticData.h"
#include "Util.h"