#include <BilingualLM.h>
Public Member Functions | |
BilingualLM (const std::string &line) | |
bool | IsUseable (const FactorMask &mask) const |
virtual const FFState * | EmptyHypothesisState (const InputType &input) const |
return the state associated with the empty hypothesis for a given sentence | |
void | Load (AllOptions::ptr const &opts) |
override to load model files | |
FFState * | EvaluateWhenApplied (const Hypothesis &cur_hypo, const FFState *prev_state, ScoreComponentCollection *accumulator) const |
This interface should be implemented. Notes: When evaluating the value of this feature function, you should avoid calling hypo.GetPrevHypo(). If you need something from the "previous" hypothesis, you should store it in an FFState object which will be passed in as prev_state. If you don't do this, you will get in trouble. | |
FFState * | EvaluateWhenApplied (const ChartHypothesis &cur_hypo, int featureID, ScoreComponentCollection *accumulator) const |
void | SetParameter (const std::string &key, const std::string &value) |
Protected Attributes | |
std::string | m_filePath |
int | target_ngrams |
int | source_ngrams |
FactorType | word_factortype |
FactorType | pos_factortype |
const Factor * | BOS_factor |
const Factor * | EOS_factor |
Word | BOS_word |
Word | EOS_word |
Definition at line 50 of file BilingualLM.h.
Moses::BilingualLM::BilingualLM | ( | const std::string & | line | ) |
Definition at line 11 of file BilingualLM.cpp.
References Moses::FactorCollection::AddFactor(), BOS_, BOS_factor, BOS_word, EOS_, EOS_factor, EOS_word, Moses::FactorCollection::Instance(), and Moses::Word::SetFactor().
virtual const FFState* Moses::BilingualLM::EmptyHypothesisState | ( | const InputType & | input | ) | const [inline, virtual] |
return the state associated with the empty hypothesis for a given sentence
Implements Moses::StatefulFeatureFunction.
Definition at line 116 of file BilingualLM.h.
FFState * Moses::BilingualLM::EvaluateWhenApplied | ( | const ChartHypothesis & | cur_hypo, | |
int | featureID, | |||
ScoreComponentCollection * | accumulator | |||
) | const [virtual] |
Implements Moses::StatefulFeatureFunction.
Definition at line 405 of file BilingualLM.cpp.
References BOS_word, Moses::ChartHypothesis::GetCurrTargetPhrase(), Moses::ChartHypothesis::GetManager(), Moses::Phrase::GetNumNonTerminals(), Moses::Phrase::GetNumTerminals(), Moses::ChartHypothesis::GetPrevHypo(), Moses::ChartHypothesis::GetPrevHypos(), Moses::ChartHypothesis::GetScoreBreakdown(), Moses::ScoreComponentCollection::GetScoreForProducer(), Moses::Phrase::GetSize(), Moses::BaseManager::GetSource(), Moses::ScoreComponentCollection::PlusEquals(), and source_ngrams.
FFState * Moses::BilingualLM::EvaluateWhenApplied | ( | const Hypothesis & | cur_hypo, | |
const FFState * | prev_state, | |||
ScoreComponentCollection * | accumulator | |||
) | const [virtual] |
This interface should be implemented. Notes: When evaluating the value of this feature function, you should avoid calling hypo.GetPrevHypo(). If you need something from the "previous" hypothesis, you should store it in an FFState object which will be passed in as prev_state. If you don't do this, you will get in trouble.
Implements Moses::StatefulFeatureFunction.
Definition at line 192 of file BilingualLM.cpp.
References Moses::Hypothesis::GetCurrSourceWordsRange(), Moses::Hypothesis::GetCurrTargetPhrase(), Moses::Hypothesis::GetManager(), Moses::Phrase::GetSize(), Moses::Manager::GetSource(), Moses::ScoreComponentCollection::PlusEquals(), and source_ngrams.
bool Moses::BilingualLM::IsUseable | ( | const FactorMask & | mask | ) | const [inline, virtual] |
void Moses::BilingualLM::Load | ( | AllOptions::ptr const & | opts | ) | [virtual] |
override to load model files
Reimplemented from Moses::FeatureFunction.
Definition at line 23 of file BilingualLM.cpp.
References Moses::FeatureFunction::m_options, and Moses::FeatureFunction::ReadParameters().
void Moses::BilingualLM::SetParameter | ( | const std::string & | key, | |
const std::string & | value | |||
) | [virtual] |
Reimplemented from Moses::FeatureFunction.
Definition at line 468 of file BilingualLM.cpp.
References m_filePath.
const Factor* Moses::BilingualLM::BOS_factor [protected] |
Word Moses::BilingualLM::BOS_word [mutable, protected] |
Definition at line 107 of file BilingualLM.h.
Referenced by BilingualLM(), and EvaluateWhenApplied().
const Factor* Moses::BilingualLM::EOS_factor [protected] |
Word Moses::BilingualLM::EOS_word [mutable, protected] |
std::string Moses::BilingualLM::m_filePath [protected] |
FactorType Moses::BilingualLM::pos_factortype [protected] |
Definition at line 104 of file BilingualLM.h.
int Moses::BilingualLM::source_ngrams [protected] |
int Moses::BilingualLM::target_ngrams [protected] |
Definition at line 99 of file BilingualLM.h.
FactorType Moses::BilingualLM::word_factortype [protected] |
Definition at line 103 of file BilingualLM.h.