diff --git a/mira/Decoder.cpp b/mira/Decoder.cpp index 5bbc721ac..2e3caae17 100644 --- a/mira/Decoder.cpp +++ b/mira/Decoder.cpp @@ -63,6 +63,15 @@ namespace Mira { } delete[] mosesargv; } + + MosesDecoder::MosesDecoder() + : m_manager(NULL) + { + //force initialisation of the phrase dictionary + string source("hello"); + MosesChart::TrellisPathList sentences; + getNBest(source,1,sentences); + } void MosesDecoder::cleanup() { diff --git a/mira/Decoder.h b/mira/Decoder.h index 38acff96e..3422c3947 100644 --- a/mira/Decoder.h +++ b/mira/Decoder.h @@ -62,9 +62,7 @@ class Decoder { **/ class MosesDecoder : public Decoder { public: - MosesDecoder() - : m_manager(NULL) - {} + MosesDecoder(); virtual void getNBest(const std::string& source, size_t count, MosesChart::TrellisPathList& sentences); void cleanup();