mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-10-06 08:18:02 +03:00
get rid of id in LM class
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@452 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
parent
eacaf8404d
commit
d6377d7754
@ -38,7 +38,7 @@ protected:
|
||||
const Factor *m_sentenceStart, *m_sentenceEnd;
|
||||
FactorType m_factorType;
|
||||
float m_weight;
|
||||
size_t m_id, m_nGramOrder;
|
||||
size_t m_nGramOrder;
|
||||
LmId m_unknownId;
|
||||
std::string m_filename;
|
||||
public:
|
||||
@ -49,8 +49,7 @@ public:
|
||||
|
||||
LanguageModel();
|
||||
virtual ~LanguageModel();
|
||||
virtual void Load(size_t id
|
||||
, const std::string &fileName
|
||||
virtual void Load(const std::string &fileName
|
||||
, FactorCollection &factorCollection
|
||||
, FactorType factorType
|
||||
, float weight
|
||||
@ -89,10 +88,6 @@ public:
|
||||
{
|
||||
m_weight = weight;
|
||||
}
|
||||
size_t GetId() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
virtual const std::string GetScoreProducerDescription() const;
|
||||
virtual float GetValue(const std::vector<const Factor*> &contextFactor, State* finalState = 0) const = 0;
|
||||
|
||||
|
@ -48,14 +48,12 @@ LanguageModel_IRST::~LanguageModel_IRST()
|
||||
}
|
||||
|
||||
|
||||
void LanguageModel_IRST::Load(size_t id
|
||||
, const std::string &fileName
|
||||
void LanguageModel_IRST::Load(const std::string &fileName
|
||||
, FactorCollection &factorCollection
|
||||
, FactorType factorType
|
||||
, float weight
|
||||
, size_t nGramOrder)
|
||||
{
|
||||
m_id = id;
|
||||
m_factorType = factorType;
|
||||
m_weight = weight;
|
||||
m_nGramOrder = nGramOrder;
|
||||
|
@ -42,8 +42,7 @@ public:
|
||||
|
||||
LanguageModel_IRST();
|
||||
~LanguageModel_IRST();
|
||||
void Load(size_t id
|
||||
, const std::string &fileName
|
||||
void Load(const std::string &fileName
|
||||
, FactorCollection &factorCollection
|
||||
, FactorType factorType
|
||||
, float weight
|
||||
|
@ -40,14 +40,12 @@ LanguageModel_Internal::LanguageModel_Internal()
|
||||
{
|
||||
}
|
||||
|
||||
void LanguageModel_Internal::Load(size_t id
|
||||
, const std::string &fileName
|
||||
void LanguageModel_Internal::Load(const std::string &fileName
|
||||
, FactorCollection &factorCollection
|
||||
, FactorType factorType
|
||||
, float weight
|
||||
, size_t nGramOrder)
|
||||
{
|
||||
m_id = id;
|
||||
m_factorType = factorType;
|
||||
m_weight = weight;
|
||||
m_nGramOrder = nGramOrder;
|
||||
|
@ -38,8 +38,7 @@ class LanguageModel_Internal : public LanguageModel
|
||||
public:
|
||||
|
||||
LanguageModel_Internal();
|
||||
void Load(size_t id
|
||||
, const std::string &fileName
|
||||
void Load(const std::string &fileName
|
||||
, FactorCollection &factorCollection
|
||||
, FactorType factorType
|
||||
, float weight
|
||||
|
@ -49,8 +49,7 @@ protected:
|
||||
public:
|
||||
LanguageModel_SRI();
|
||||
~LanguageModel_SRI();
|
||||
void Load(size_t id
|
||||
, const std::string &fileName
|
||||
void Load(const std::string &fileName
|
||||
, FactorCollection &factorCollection
|
||||
, FactorType factorType
|
||||
, float weight
|
||||
|
@ -274,7 +274,7 @@ bool StaticData::LoadParameters(int argc, char* argv[])
|
||||
LanguageModel *lm = LanguageModelFactory::createLanguageModel();
|
||||
|
||||
// error handling here?
|
||||
lm->Load(i, languageModelFile, m_factorCollection, factorType, weightAll[i], nGramOrder);
|
||||
lm->Load(languageModelFile, m_factorCollection, factorType, weightAll[i], nGramOrder);
|
||||
timer.check(("Finished loading LanguageModel " + languageModelFile).c_str());
|
||||
m_languageModel.push_back(lm);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user