Moses::CorrectionPattern Class Reference

#include <CorrectionPattern.h>

Inheritance diagram for Moses::CorrectionPattern:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 CorrectionPattern (const std::string &line)
bool IsUseable (const FactorMask &mask) const
void EvaluateInIsolation (const Phrase &source, const TargetPhrase &targetPhrase, ScoreComponentCollection &scoreBreakdown, ScoreComponentCollection &estimatedFutureScore) const
virtual void EvaluateWithSourceContext (const InputType &input, const InputPath &inputPath, const TargetPhrase &targetPhrase, const StackVec *stackVec, ScoreComponentCollection &scoreBreakdown, ScoreComponentCollection *estimatedFutureScore=NULL) const
void EvaluateTranslationOptionListWithSourceContext (const InputType &input, const TranslationOptionList &translationOptionList) const
void EvaluateWhenApplied (const Hypothesis &hypo, ScoreComponentCollection *accumulator) const
void EvaluateWhenApplied (const ChartHypothesis &hypo, ScoreComponentCollection *accumulator) const
void ComputeFeatures (const InputType &input, const InputPath &inputPath, const TargetPhrase &targetPhrase, ScoreComponentCollection *accumulator) const
void SetParameter (const std::string &key, const std::string &value)
std::vector< std::string > CreatePattern (const Tokens &s1, const Tokens &s2, const InputType &input, const InputPath &inputPath) const
std::string CreateSinglePattern (const Tokens &s1, const Tokens &s2) const


Detailed Description

Sets the features for length of source phrase, target phrase, both.

Definition at line 18 of file CorrectionPattern.h.


Constructor & Destructor Documentation

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

Definition at line 278 of file CorrectionPattern.cpp.

References Moses::FeatureFunction::ReadParameters().

Here is the call graph for this function:


Member Function Documentation

void Moses::CorrectionPattern::ComputeFeatures ( const InputType input,
const InputPath inputPath,
const TargetPhrase targetPhrase,
ScoreComponentCollection accumulator 
) const

Definition at line 311 of file CorrectionPattern.cpp.

References CreatePattern(), Moses::InputPath::GetPhrase(), Moses::Phrase::GetSize(), Moses::Word::GetString(), Moses::Phrase::GetWord(), and Moses::ScoreComponentCollection::PlusEquals().

Referenced by EvaluateWithSourceContext().

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< std::string > Moses::CorrectionPattern::CreatePattern ( const Tokens s1,
const Tokens s2,
const InputType input,
const InputPath inputPath 
) const

Definition at line 206 of file CorrectionPattern.cpp.

References Moses::CreateDiff(), CreateSinglePattern(), and Moses::GetContext().

Referenced by ComputeFeatures().

Here is the call graph for this function:

Here is the caller graph for this function:

std::string Moses::CorrectionPattern::CreateSinglePattern ( const Tokens s1,
const Tokens s2 
) const

Definition at line 136 of file CorrectionPattern.cpp.

References TERCPPNS_Tools::join(), and Moses::MakePair().

Referenced by CreatePattern().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::CorrectionPattern::EvaluateInIsolation ( const Phrase source,
const TargetPhrase targetPhrase,
ScoreComponentCollection scoreBreakdown,
ScoreComponentCollection estimatedFutureScore 
) const [inline, virtual]

Implements Moses::FeatureFunction.

Definition at line 31 of file CorrectionPattern.h.

void Moses::CorrectionPattern::EvaluateTranslationOptionListWithSourceContext ( const InputType input,
const TranslationOptionList translationOptionList 
) const [inline, virtual]

Implements Moses::FeatureFunction.

Definition at line 44 of file CorrectionPattern.h.

void Moses::CorrectionPattern::EvaluateWhenApplied ( const ChartHypothesis hypo,
ScoreComponentCollection accumulator 
) const [inline, virtual]

Same for chart-based features.

Implements Moses::StatelessFeatureFunction.

Definition at line 51 of file CorrectionPattern.h.

void Moses::CorrectionPattern::EvaluateWhenApplied ( const Hypothesis hypo,
ScoreComponentCollection accumulator 
) const [inline, virtual]

This should be implemented for features that apply to phrase-based models.

Implements Moses::StatelessFeatureFunction.

Definition at line 48 of file CorrectionPattern.h.

void Moses::CorrectionPattern::EvaluateWithSourceContext ( const InputType input,
const InputPath inputPath,
const TargetPhrase targetPhrase,
const StackVec stackVec,
ScoreComponentCollection scoreBreakdown,
ScoreComponentCollection estimatedFutureScore = NULL 
) const [virtual]

Implements Moses::FeatureFunction.

Definition at line 301 of file CorrectionPattern.cpp.

References ComputeFeatures().

Here is the call graph for this function:

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

Implements Moses::FeatureFunction.

Definition at line 344 of file CorrectionPattern.cpp.

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

Reimplemented from Moses::FeatureFunction.

Definition at line 286 of file CorrectionPattern.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:01 2017 for Moses by  doxygen 1.5.9