void WordPenaltyProducer::Evaluate( const PhraseBasedFeatureContext& context, ScoreComponentCollection* out) const { const TargetPhrase& tp = context.GetTargetPhrase(); out->PlusEquals(this, -static_cast<float>(tp.GetSize())); }
void SourceWordDeletionFeature::Evaluate( const PhraseBasedFeatureContext& context, ScoreComponentCollection* accumulator) const { const TargetPhrase& targetPhrase = context.GetTargetPhrase(); const AlignmentInfo &alignmentInfo = targetPhrase.GetAlignTerm(); ComputeFeatures(targetPhrase, accumulator, alignmentInfo); }
void TargetWordInsertionFeature::Evaluate( const PhraseBasedFeatureContext& context, ScoreComponentCollection* accumulator) const { const TargetPhrase& targetPhrase = context.GetTargetPhrase(); const AlignmentInfo &alignmentInfo = targetPhrase.GetAlignmentInfo(); const AlignmentInfo::CollType &alignment = alignmentInfo.GetAlignments(); ComputeFeatures(targetPhrase, accumulator, alignment); }
void CacheBasedLanguageModel::Evaluate(const PhraseBasedFeatureContext& context, ScoreComponentCollection* accumulator) const { const TargetPhrase& tp = context.GetTargetPhrase(); Evaluate(tp, accumulator); }
void HyperParameterAsWeight::Evaluate(const PhraseBasedFeatureContext& context, ScoreComponentCollection* accumulator) const { const TargetPhrase& tp = context.GetTargetPhrase(); Evaluate(tp, accumulator); }