Moses::ConstrainedDecoding Class Reference

#include <ConstrainedDecoding.h>

Inheritance diagram for Moses::ConstrainedDecoding:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

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

Protected Attributes

std::vector< std::string > m_paths
std::map< long, std::vector
< Phrase > > 
m_constraints
int m_maxUnknowns
bool m_negate
bool m_soft


Detailed Description

Definition at line 34 of file ConstrainedDecoding.h.


Constructor & Destructor Documentation

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

Definition at line 39 of file ConstrainedDecoding.cpp.

References Moses::FeatureFunction::m_tuneable, and Moses::FeatureFunction::ReadParameters().

Here is the call graph for this function:


Member Function Documentation

std::vector< float > Moses::ConstrainedDecoding::DefaultWeights (  )  const [virtual]

Reimplemented from Moses::FeatureFunction.

Definition at line 82 of file ConstrainedDecoding.cpp.

References Moses::FeatureFunction::m_numScoreComponents, and UTIL_THROW_IF2.

virtual const FFState* Moses::ConstrainedDecoding::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 55 of file ConstrainedDecoding.h.

FFState * Moses::ConstrainedDecoding::EvaluateWhenApplied ( const ChartHypothesis hypo,
int  ,
ScoreComponentCollection accumulator 
) const [virtual]

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

References Moses::ConstrainedDecodingState::GetPhrase(), Moses::Phrase::GetSize(), Moses::Hypothesis::IsSourceCompleted(), m_constraints, m_maxUnknowns, m_negate, m_soft, NOT_FOUND, and Moses::ScoreComponentCollection::PlusEquals().

Here is the call graph for this function:

bool Moses::ConstrainedDecoding::IsUseable ( const FactorMask mask  )  const [inline, virtual]

Implements Moses::FeatureFunction.

Definition at line 41 of file ConstrainedDecoding.h.

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

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

Reimplemented from Moses::FeatureFunction.

Definition at line 196 of file ConstrainedDecoding.cpp.

References m_maxUnknowns, m_negate, m_paths, m_soft, Moses::Scan< bool >(), and Moses::Tokenize().

Here is the call graph for this function:


Member Data Documentation

std::map<long, std::vector<Phrase> > Moses::ConstrainedDecoding::m_constraints [protected]

Definition at line 65 of file ConstrainedDecoding.h.

Referenced by EvaluateWhenApplied(), and Load().

Definition at line 66 of file ConstrainedDecoding.h.

Referenced by EvaluateWhenApplied(), and SetParameter().

Definition at line 67 of file ConstrainedDecoding.h.

Referenced by EvaluateWhenApplied(), and SetParameter().

std::vector<std::string> Moses::ConstrainedDecoding::m_paths [protected]

Definition at line 64 of file ConstrainedDecoding.h.

Referenced by Load(), and SetParameter().

Definition at line 68 of file ConstrainedDecoding.h.

Referenced by EvaluateWhenApplied(), and SetParameter().


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

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