diff options
author | Matthias Huck <huck@i6.informatik.rwth-aachen.de> | 2015-02-25 03:52:15 +0300 |
---|---|---|
committer | Matthias Huck <huck@i6.informatik.rwth-aachen.de> | 2015-02-25 03:52:15 +0300 |
commit | 39c1ef52dc04e88b4205869aaff54459ad8ab80d (patch) | |
tree | 2d70078df61fd4930f39d686cb8ebe0540b757fd /moses/FF | |
parent | 3c8d48f8af7c65c4cc6cf731e6eee6dd6f8f29db (diff) |
Model1Feature: unnecessary includes & special UNK token in MGIZA vocabularies
Diffstat (limited to 'moses/FF')
-rw-r--r-- | moses/FF/Model1Feature.cpp | 7 | ||||
-rw-r--r-- | moses/FF/Model1Feature.h | 1 |
2 files changed, 1 insertions, 7 deletions
diff --git a/moses/FF/Model1Feature.cpp b/moses/FF/Model1Feature.cpp index d6b9a0a8b..c4888a1ea 100644 --- a/moses/FF/Model1Feature.cpp +++ b/moses/FF/Model1Feature.cpp @@ -1,12 +1,7 @@ -#include <assert.h> -#include "util/exception.hh" #include "Model1Feature.h" #include "moses/StaticData.h" #include "moses/InputFileStream.h" #include "moses/ScoreComponentCollection.h" -#include "moses/Hypothesis.h" -#include "moses/ChartHypothesis.h" -#include "moses/ChartManager.h" #include "moses/FactorCollection.h" @@ -84,7 +79,7 @@ void Model1Vocabulary::Load(const std::string& fileName) unsigned id = Scan<unsigned>(tokens[0]); const Factor* factor = factorCollection.AddFactor(tokens[1],false); // TODO: can we assume that the vocabulary is know and filter the model on loading? bool stored = Store(factor, id); - UTIL_THROW_IF2(!stored, "Line " << i << " in " << fileName << " overwrites existing vocabulary entry."); + UTIL_THROW_IF2(!stored && (tokens[1] != "UNK"), "Line " << i << " in " << fileName << " overwrites existing vocabulary entry."); } inFile.Close(); } diff --git a/moses/FF/Model1Feature.h b/moses/FF/Model1Feature.h index 7df941e7a..13732db6d 100644 --- a/moses/FF/Model1Feature.h +++ b/moses/FF/Model1Feature.h @@ -4,7 +4,6 @@ #include <limits> #include <boost/unordered_map.hpp> #include "StatelessFeatureFunction.h" -#include "FFState.h" #include "moses/Factor.h" namespace Moses |