2013-11-05 18:37:56 +04:00
|
|
|
// $Id$
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
2013-11-11 23:49:00 +04:00
|
|
|
#include <boost/bimap.hpp>
|
2013-11-05 18:37:56 +04:00
|
|
|
#include "SingleFactor.h"
|
|
|
|
|
2013-11-11 21:19:44 +04:00
|
|
|
namespace DALM
|
|
|
|
{
|
|
|
|
class Logger;
|
|
|
|
class Vocabulary;
|
|
|
|
class LM;
|
2013-11-11 23:49:00 +04:00
|
|
|
|
|
|
|
typedef unsigned int VocabId;
|
2013-11-11 21:19:44 +04:00
|
|
|
}
|
|
|
|
|
2013-11-05 18:37:56 +04:00
|
|
|
namespace Moses
|
|
|
|
{
|
2013-11-11 23:49:00 +04:00
|
|
|
class Factor;
|
2013-11-05 18:37:56 +04:00
|
|
|
|
|
|
|
class LanguageModelDALM : public LanguageModelSingleFactor
|
|
|
|
{
|
|
|
|
protected:
|
2013-11-11 18:39:53 +04:00
|
|
|
std::string m_inifile;
|
2013-11-11 21:19:44 +04:00
|
|
|
DALM::Logger *m_logger;
|
|
|
|
DALM::Vocabulary *m_vocab;
|
|
|
|
DALM::LM *m_lm;
|
2013-11-05 18:37:56 +04:00
|
|
|
|
2013-11-11 23:49:00 +04:00
|
|
|
DALM::VocabId wid_start, wid_end;
|
|
|
|
|
|
|
|
DALM::VocabId GetVocabId(const Factor *factor) const;
|
|
|
|
|
2013-11-05 18:37:56 +04:00
|
|
|
public:
|
|
|
|
LanguageModelDALM(const std::string &line);
|
|
|
|
~LanguageModelDALM();
|
2013-11-11 18:39:53 +04:00
|
|
|
void Load();
|
2013-11-05 18:37:56 +04:00
|
|
|
|
|
|
|
virtual LMResult GetValue(const std::vector<const Word*> &contextFactor, State* finalState = 0) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|