Moses::TargetBigramFeature Class Reference

#include <TargetBigramFeature.h>

Inheritance diagram for Moses::TargetBigramFeature:

Inheritance graph
[legend]
Collaboration diagram for Moses::TargetBigramFeature:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 TargetBigramFeature (const std::string &line)
void Load (AllOptions::ptr const &opts)
 override to load model files
bool IsUseable (const FactorMask &mask) const
virtual const FFStateEmptyHypothesisState (const InputType &input) const
 return the state associated with the empty hypothesis for a given sentence
virtual FFStateEvaluateWhenApplied (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.
virtual FFStateEvaluateWhenApplied (const ChartHypothesis &, int, ScoreComponentCollection *) const
void SetParameter (const std::string &key, const std::string &value)


Detailed Description

Sets the features of observed bigrams.

Definition at line 32 of file TargetBigramFeature.h.


Constructor & Destructor Documentation

Moses::TargetBigramFeature::TargetBigramFeature ( const std::string &  line  ) 


Member Function Documentation

const FFState * Moses::TargetBigramFeature::EmptyHypothesisState ( const InputType input  )  const [virtual]

return the state associated with the empty hypothesis for a given sentence

Implements Moses::StatefulFeatureFunction.

Definition at line 70 of file TargetBigramFeature.cpp.

virtual FFState* Moses::TargetBigramFeature::EvaluateWhenApplied ( const ChartHypothesis ,
int  ,
ScoreComponentCollection  
) const [inline, virtual]

Implements Moses::StatefulFeatureFunction.

Definition at line 46 of file TargetBigramFeature.h.

FFState * Moses::TargetBigramFeature::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 75 of file TargetBigramFeature.cpp.

References StringPiece::data(), EOS_, FindStringPiece(), Moses::Hypothesis::GetCurrTargetPhrase(), Moses::Word::GetFactor(), Moses::Phrase::GetSize(), Moses::Word::GetString(), Moses::Factor::GetString(), Moses::Phrase::GetWord(), Moses::TargetBigramState::GetWord(), Moses::Hypothesis::GetWordsBitmap(), Moses::Bitmap::IsComplete(), NULL, Moses::ScoreComponentCollection::PlusEquals(), and StringPiece::size().

Here is the call graph for this function:

bool Moses::TargetBigramFeature::IsUseable ( const FactorMask mask  )  const [virtual]

Implements Moses::FeatureFunction.

Definition at line 126 of file TargetBigramFeature.cpp.

void Moses::TargetBigramFeature::Load ( AllOptions::ptr const &  opts  )  [virtual]

override to load model files

Reimplemented from Moses::FeatureFunction.

Definition at line 51 of file TargetBigramFeature.cpp.

References BOS_, Moses::FeatureFunction::m_options, and UTIL_THROW_IF2.

void Moses::TargetBigramFeature::SetParameter ( const std::string &  key,
const std::string &  value 
) [virtual]

Reimplemented from Moses::FeatureFunction.

Definition at line 40 of file TargetBigramFeature.cpp.


The documentation for this class was generated from the following files:

Generated on Thu Jul 6 00:33:11 2017 for Moses by  doxygen 1.5.9