#include <VW.h>
Public Member Functions | |
VW (const std::string &line) | |
virtual | ~VW () |
bool | IsUseable (const FactorMask &mask) const |
void | EvaluateInIsolation (const Phrase &source, const TargetPhrase &targetPhrase, ScoreComponentCollection &scoreBreakdown, ScoreComponentCollection &estimatedFutureScore) const |
void | EvaluateWithSourceContext (const InputType &input, const InputPath &inputPath, const TargetPhrase &targetPhrase, const StackVec *stackVec, ScoreComponentCollection &scoreBreakdown, ScoreComponentCollection *estimatedFutureScore=NULL) const |
virtual void | EvaluateTranslationOptionListWithSourceContext (const InputType &input, const TranslationOptionList &translationOptionList) const |
virtual FFState * | EvaluateWhenApplied (const Hypothesis &curHypo, const FFState *prevState, 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. | |
virtual FFState * | EvaluateWhenApplied (const ChartHypothesis &, int, ScoreComponentCollection *accumulator) const |
const FFState * | EmptyHypothesisState (const InputType &input) const |
return the state associated with the empty hypothesis for a given sentence | |
void | SetParameter (const std::string &key, const std::string &value) |
virtual void | InitializeForInput (ttasksptr const &ttask) |
Called before search and collecting of translation options. |
Definition at line 67 of file VW.h.
Moses::VW::VW | ( | const std::string & | line | ) |
Definition at line 35 of file VW.cpp.
References Moses::FactorCollection::AddFactor(), BOS_, Moses::FactorCollection::Instance(), Moses::FeatureFunction::ReadParameters(), Moses::Word::SetFactor(), and VERBOSE.
return the state associated with the empty hypothesis for a given sentence
Implements Moses::StatefulFeatureFunction.
Definition at line 183 of file VW.cpp.
References Moses::Phrase::AddWord(), Moses::VWFeatureBase::GetMaximumContextSize(), and Moses::FeatureFunction::GetScoreProducerDescription().
void Moses::VW::EvaluateInIsolation | ( | const Phrase & | source, | |
const TargetPhrase & | targetPhrase, | |||
ScoreComponentCollection & | scoreBreakdown, | |||
ScoreComponentCollection & | estimatedFutureScore | |||
) | const [inline, virtual] |
void Moses::VW::EvaluateTranslationOptionListWithSourceContext | ( | const InputType & | input, | |
const TranslationOptionList & | translationOptionList | |||
) | const [virtual] |
Reimplemented from Moses::StatefulFeatureFunction.
Definition at line 193 of file VW.cpp.
References Moses::Phrase::AddWord(), Moses::Phrase::Append(), Moses::TranslationOptionList::begin(), Moses::FloorScore(), Moses::TranslationOptionList::Get(), Moses::VWFeatureBase::GetMaximumContextSize(), Moses::TranslationOption::GetScoreBreakdown(), Moses::FeatureFunction::GetScoreProducerDescription(), Moses::VWFeatureBase::GetSourceFeatures(), Moses::TranslationOption::GetSourceWordsRange(), Moses::ThreadLocalByFeatureStorage< VWTargetSentence >::GetStored(), Moses::ThreadLocalByFeatureStorage< Value, Factory >::GetStored(), Moses::Phrase::GetSubString(), Moses::VWFeatureBase::GetTargetContextFeatures(), Moses::VWFeatureBase::GetTargetFeatures(), Moses::TranslationOption::GetTargetPhrase(), Moses::hash_value(), Moses::FeatureFunction::m_numScoreComponents, Moses::ScoreComponentCollection::PlusEquals(), Moses::TranslationOptionList::size(), Moses::TransformScore(), Moses::TranslationOption::UpdateScore(), VERBOSE, and Moses::VW_DUMMY_LABEL.
virtual FFState* Moses::VW::EvaluateWhenApplied | ( | const ChartHypothesis & | , | |
int | , | |||
ScoreComponentCollection * | accumulator | |||
) | const [inline, virtual] |
FFState * Moses::VW::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 76 of file VW.cpp.
References Moses::FloorScore(), Moses::TranslationOptionList::Get(), Moses::TranslationOption::GetEndPos(), Moses::Hypothesis::GetManager(), Moses::VWState::GetPhrase(), Moses::FeatureFunction::GetScoreProducerDescription(), Moses::Phrase::GetSize(), Moses::Manager::getSntTranslationOptions(), Moses::Manager::GetSource(), Moses::TranslationOption::GetStartPos(), Moses::ThreadLocalByFeatureStorage< Value, Factory >::GetStored(), Moses::VWFeatureBase::GetTargetContextFeatures(), Moses::TranslationOption::GetTargetPhrase(), Moses::Hypothesis::GetTranslationOption(), Moses::TranslationOptionCollection::GetTranslationOptionList(), Moses::VWState::hash(), Moses::hash_value(), Moses::FeatureFunction::m_numScoreComponents, Moses::ScoreComponentCollection::PlusEquals(), Moses::TranslationOptionList::size(), Moses::TransformScore(), and VERBOSE.
void Moses::VW::EvaluateWithSourceContext | ( | const InputType & | input, | |
const InputPath & | inputPath, | |||
const TargetPhrase & | targetPhrase, | |||
const StackVec * | stackVec, | |||
ScoreComponentCollection & | scoreBreakdown, | |||
ScoreComponentCollection * | estimatedFutureScore = NULL | |||
) | const [inline, virtual] |
void Moses::VW::InitializeForInput | ( | ttasksptr const & | ttask | ) | [virtual] |
Called before search and collecting of translation options.
Reimplemented from Moses::FeatureFunction.
Definition at line 413 of file VW.cpp.
References Moses::InputType::GetSize(), Moses::ThreadLocalByFeatureStorage< VWTargetSentence >::GetStored(), Moses::ThreadLocalByFeatureStorage< Value, Factory >::GetStored(), Moses::InputType::GetType(), Moses::StaticData::Instance(), NULL, Moses::FeatureFunction::options(), Moses::Output, Moses::TabbedSentenceInput, and UTIL_THROW_IF2.
bool Moses::VW::IsUseable | ( | const FactorMask & | mask | ) | const [inline, virtual] |
void Moses::VW::SetParameter | ( | const std::string & | key, | |
const std::string & | value | |||
) | [virtual] |
Reimplemented from Moses::FeatureFunction.
Definition at line 379 of file VW.cpp.
References Moses::Scan< bool >(), and UTIL_THROW2.