Moses::TargetNgramFeature Class Reference

#include <TargetNgramFeature.h>

Inheritance diagram for Moses::TargetNgramFeature:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 TargetNgramFeature (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 &cur_hypo, int featureId, ScoreComponentCollection *accumulator) const
void SetParameter (const std::string &key, const std::string &value)


Detailed Description

Sets the features of observed ngrams.

Definition at line 201 of file TargetNgramFeature.h.


Constructor & Destructor Documentation

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


Member Function Documentation

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

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

Implements Moses::StatefulFeatureFunction.

Definition at line 100 of file TargetNgramFeature.cpp.

FFState * Moses::TargetNgramFeature::EvaluateWhenApplied ( const ChartHypothesis cur_hypo,
int  featureId,
ScoreComponentCollection accumulator 
) const [virtual]

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

References EOS_, FindStringPiece(), Moses::Hypothesis::GetCurrTargetPhrase(), Moses::Hypothesis::GetSize(), Moses::Phrase::GetSize(), Moses::Word::GetString(), Moses::Hypothesis::GetWord(), Moses::Phrase::GetWord(), Moses::TargetNgramState::GetWords(), Moses::Hypothesis::GetWordsBitmap(), Moses::Bitmap::IsComplete(), n, Moses::ScoreComponentCollection::PlusEquals(), skip, and util::StringStream::str().

Here is the call graph for this function:

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

Implements Moses::FeatureFunction.

Definition at line 461 of file TargetNgramFeature.cpp.

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

override to load model files

Reimplemented from Moses::FeatureFunction.

Definition at line 77 of file TargetNgramFeature.cpp.

References BOS_, EOS_, Moses::FeatureFunction::m_options, and UTIL_THROW.

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

Reimplemented from Moses::FeatureFunction.

Definition at line 62 of file TargetNgramFeature.cpp.

References Moses::Scan< bool >().

Here is the call graph for this function:


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

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