Force the initialisation of the phrase dictionary

git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/branches/mira-mtm5@3499 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
bhaddow 2010-09-17 08:33:22 +00:00
parent 2c4e85a910
commit ff93086924
2 changed files with 10 additions and 3 deletions

View File

@ -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()
{

View File

@ -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();