Moses::TargetPhrase Class Reference

#include <TargetPhrase.h>

Inheritance diagram for Moses::TargetPhrase:

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

Collaboration graph
[legend]

List of all members.

Public Types

typedef std::map
< FeatureFunction const
*, boost::shared_ptr< Scores > > 
ScoreCache_t
typedef std::map< size_t const,
std::vector< SPTR< std::vector
< float > > > > 
CoordCache_t

Public Member Functions

ScoreCache_t const & GetExtraScores () const
Scores const * GetExtraScores (FeatureFunction const *ff) const
void SetExtraScores (FeatureFunction const *ff, boost::shared_ptr< Scores > const &scores)
std::vector< SPTR< std::vector
< float > > > const * 
GetCoordList (size_t const spaceID) const
void PushCoord (size_t const spaceID, SPTR< std::vector< float > > const coord)
 TargetPhrase (const PhraseDictionary *pt=NULL)
 TargetPhrase (std::string out_string, const PhraseDictionary *pt=NULL)
 TargetPhrase (const TargetPhrase &copy)
 TargetPhrase (const Phrase &targetPhrase, const PhraseDictionary *pt)
 TargetPhrase (ttasksptr &ttask, const PhraseDictionary *pt=NULL)
 TargetPhrase (ttasksptr &ttask, std::string out_string, const PhraseDictionary *pt=NULL)
 TargetPhrase (ttasksptr &ttask, const Phrase &targetPhrase, const PhraseDictionary *pt)
bool HasScope () const
SPTR< ContextScopeGetScope () const
 ~TargetPhrase ()
void EvaluateInIsolation (const Phrase &source, const std::vector< FeatureFunction * > &ffs)
void EvaluateInIsolation (const Phrase &source)
void EvaluateWithSourceContext (const InputType &input, const InputPath &inputPath)
void UpdateScore (ScoreComponentCollection *futureScoreBreakdown=NULL)
void SetSparseScore (const FeatureFunction *translationScoreProducer, const StringPiece &sparseString)
void SetXMLScore (float score)
float GetFutureScore () const
const ScoreComponentCollectionGetScoreBreakdown () const
ScoreComponentCollectionGetScoreBreakdown ()
void SetTargetLHS (const Word *lhs)
const WordGetTargetLHS () const
void SetAlignmentInfo (const StringPiece &alignString)
void SetAlignTerm (const AlignmentInfo *alignTerm)
void SetAlignNonTerm (const AlignmentInfo *alignNonTerm)
template<typename ALNREP >
void SetAlignTerm (const ALNREP &coll)
template<typename ALNREP >
void SetAlignNonTerm (const ALNREP &coll)
const AlignmentInfoGetAlignTerm () const
const AlignmentInfoGetAlignNonTerm () const
const PhraseGetRuleSource () const
const PhraseDictionaryGetContainer () const
bool SetData (const std::string &key, boost::shared_ptr< void > value) const
boost::shared_ptr< void > GetData (const std::string &key) const
void SetRuleSource (const Phrase &ruleSource) const
void SetProperties (const StringPiece &str)
void SetProperty (const std::string &key, const std::string &value)
const PhrasePropertyGetProperty (const std::string &key) const
void Merge (const TargetPhrase &copy, const std::vector< FactorType > &factorVec)
bool operator< (const TargetPhrase &compare) const
bool operator== (const TargetPhrase &compare) const
 TO_STRING ()

Friends

std::ostream & operator<< (std::ostream &, const TargetPhrase &)
void swap (TargetPhrase &first, TargetPhrase &second)


Detailed Description

represents an entry on the target side of a phrase table (scores, translation, alignment)

Definition at line 51 of file TargetPhrase.h.


Member Typedef Documentation

typedef std::map<size_t const, std::vector<SPTR<std::vector<float> > > > Moses::TargetPhrase::CoordCache_t

Definition at line 59 of file TargetPhrase.h.

typedef std::map<FeatureFunction const*, boost::shared_ptr<Scores> > Moses::TargetPhrase::ScoreCache_t

Definition at line 54 of file TargetPhrase.h.


Constructor & Destructor Documentation

Moses::TargetPhrase::TargetPhrase ( const PhraseDictionary pt = NULL  ) 

Definition at line 102 of file TargetPhrase.cpp.

Moses::TargetPhrase::TargetPhrase ( std::string  out_string,
const PhraseDictionary pt = NULL 
)

Definition at line 42 of file TargetPhrase.cpp.

References Moses::Phrase::CreateFromString(), Moses::StaticData::Instance(), NULL, Moses::StaticData::options(), and Moses::Output.

Here is the call graph for this function:

Moses::TargetPhrase::TargetPhrase ( const TargetPhrase copy  ) 

Definition at line 126 of file TargetPhrase.cpp.

References NULL, and Moses::Phrase::Phrase().

Here is the call graph for this function:

Moses::TargetPhrase::TargetPhrase ( const Phrase targetPhrase,
const PhraseDictionary pt 
) [explicit]

Definition at line 114 of file TargetPhrase.cpp.

Moses::TargetPhrase::TargetPhrase ( ttasksptr ttask,
const PhraseDictionary pt = NULL 
)

Definition at line 76 of file TargetPhrase.cpp.

Moses::TargetPhrase::TargetPhrase ( ttasksptr ttask,
std::string  out_string,
const PhraseDictionary pt = NULL 
)

Definition at line 59 of file TargetPhrase.cpp.

References Moses::Phrase::CreateFromString(), NULL, and Moses::Output.

Here is the call graph for this function:

Moses::TargetPhrase::TargetPhrase ( ttasksptr ttask,
const Phrase targetPhrase,
const PhraseDictionary pt 
) [explicit]

Definition at line 89 of file TargetPhrase.cpp.

Moses::TargetPhrase::~TargetPhrase (  ) 

Definition at line 152 of file TargetPhrase.cpp.


Member Function Documentation

void Moses::TargetPhrase::EvaluateInIsolation ( const Phrase source  ) 

Definition at line 179 of file TargetPhrase.cpp.

References EvaluateInIsolation(), and Moses::FeatureFunction::GetFeatureFunctions().

Here is the call graph for this function:

void Moses::TargetPhrase::EvaluateInIsolation ( const Phrase source,
const std::vector< FeatureFunction * > &  ffs 
)

void Moses::TargetPhrase::EvaluateWithSourceContext ( const InputType input,
const InputPath inputPath 
)

const AlignmentInfo& Moses::TargetPhrase::GetAlignNonTerm (  )  const [inline]

Definition at line 187 of file TargetPhrase.h.

Referenced by Moses::UnalignedWordCountFeature::EvaluateInIsolation(), Moses::RulePairUnlexicalizedSource::EvaluateInIsolation(), Moses::PhraseOrientationFeature::EvaluateInIsolation(), Moses::RDLM::EvaluateWhenApplied(), Moses::LanguageModelImplementation::EvaluateWhenApplied(), Moses::LanguageModelDALM::EvaluateWhenApplied(), Moses::TreeStructureFeature::EvaluateWhenApplied(), Moses::TargetPreferencesFeature::EvaluateWhenApplied(), Moses::TargetNgramFeature::EvaluateWhenApplied(), Moses::SparseHieroReorderingFeature::EvaluateWhenApplied(), Moses::SoftMatchingFeature::EvaluateWhenApplied(), Moses::PhraseOrientationFeature::EvaluateWhenApplied(), Moses::SoftSourceSyntacticConstraintsFeature::EvaluateWithSourceContext(), Moses::Syntax::GetOneBestTargetYield(), Moses::PhraseDictionaryFuzzyMatch::GetOrCreateNode(), Moses::PhraseDictionaryMemory::GetOrCreateNode(), Moses::UTrieNode::GetOrCreateTargetPhraseCollection(), Moses::Syntax::S2T::RuleTrieScope3::Node::GetOrCreateTargetPhraseCollection(), Moses::Syntax::KBestExtractor::GetOutputPhrase(), Moses::ChartKBestExtractor::GetOutputPhrase(), Moses::ChartHypothesis::GetOutputPhrase(), Moses::ChartKBestExtractor::GetOutputScoreBreakdown(), Moses::Syntax::KBestExtractor::GetOutputTree(), Moses::ChartKBestExtractor::GetOutputTree(), Moses::operator<<(), Moses::PhraseOrientationFeature::SparseWordL2RScore(), and Moses::PhraseOrientationFeature::SparseWordR2LScore().

Here is the caller graph for this function:

const AlignmentInfo& Moses::TargetPhrase::GetAlignTerm (  )  const [inline]

const PhraseDictionary* Moses::TargetPhrase::GetContainer (  )  const [inline]

Definition at line 195 of file TargetPhrase.h.

Referenced by Moses::PhrasePenalty::EvaluateInIsolation().

Here is the caller graph for this function:

vector< SPTR< vector< float > > > const * Moses::TargetPhrase::GetCoordList ( size_t const   spaceID  )  const

Definition at line 339 of file TargetPhrase.cpp.

References m, and NULL.

Referenced by Moses::PhraseDistanceFeature::EvaluateWithSourceContext().

Here is the caller graph for this function:

boost::shared_ptr<void> Moses::TargetPhrase::GetData ( const std::string &  key  )  const [inline]

Definition at line 208 of file TargetPhrase.h.

Referenced by Moses::PhraseOrientationFeature::EvaluateWhenApplied().

Here is the caller graph for this function:

Scores const * Moses::TargetPhrase::GetExtraScores ( FeatureFunction const *  ff  )  const

Definition at line 323 of file TargetPhrase.cpp.

References m, and NULL.

TargetPhrase::ScoreCache_t const & Moses::TargetPhrase::GetExtraScores (  )  const

Definition at line 316 of file TargetPhrase.cpp.

Referenced by Moses::PhraseDictionaryGroup::CreateTargetPhraseCollection(), and Moses::TranslationOption::GetLexReorderingScores().

Here is the caller graph for this function:

float Moses::TargetPhrase::GetFutureScore (  )  const [inline]

const PhraseProperty * Moses::TargetPhrase::GetProperty ( const std::string &  key  )  const

const Phrase* Moses::TargetPhrase::GetRuleSource (  )  const [inline]

SPTR< ContextScope > Moses::TargetPhrase::GetScope (  )  const [virtual]

Reimplemented from Moses::Phrase.

Definition at line 174 of file TargetPhrase.cpp.

ScoreComponentCollection& Moses::TargetPhrase::GetScoreBreakdown (  )  [inline]

Definition at line 139 of file TargetPhrase.h.

const ScoreComponentCollection& Moses::TargetPhrase::GetScoreBreakdown (  )  const [inline]

const Word& Moses::TargetPhrase::GetTargetLHS (  )  const [inline]

bool Moses::TargetPhrase::HasScope (  )  const [virtual]

Reimplemented from Moses::Phrase.

Definition at line 169 of file TargetPhrase.cpp.

void Moses::TargetPhrase::Merge ( const TargetPhrase copy,
const std::vector< FactorType > &  factorVec 
)

Definition at line 299 of file TargetPhrase.cpp.

References GetScoreBreakdown(), Moses::ScoreComponentCollection::Merge(), Moses::Phrase::MergeFactors(), and Moses::mergescores().

Referenced by Moses::DecodeStepTranslation::Process(), and Moses::DecodeStepTranslation::ProcessLEGACY().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Moses::TargetPhrase::operator< ( const TargetPhrase compare  )  const

bool Moses::TargetPhrase::operator== ( const TargetPhrase compare  )  const

void Moses::TargetPhrase::PushCoord ( size_t const   spaceID,
SPTR< std::vector< float > > const   coord 
)

void Moses::TargetPhrase::SetAlignmentInfo ( const StringPiece alignString  ) 

template<typename ALNREP >
void Moses::TargetPhrase::SetAlignNonTerm ( const ALNREP &  coll  )  [inline]

Definition at line 179 of file TargetPhrase.h.

References Moses::AlignmentInfoCollection::Instance().

Here is the call graph for this function:

void Moses::TargetPhrase::SetAlignNonTerm ( const AlignmentInfo alignNonTerm  )  [inline]

Definition at line 163 of file TargetPhrase.h.

Referenced by Moses::PhraseDictionaryOnDisk::ConvertToMoses(), and SetAlignmentInfo().

Here is the caller graph for this function:

template<typename ALNREP >
void Moses::TargetPhrase::SetAlignTerm ( const ALNREP &  coll  )  [inline]

Definition at line 171 of file TargetPhrase.h.

References Moses::AlignmentInfoCollection::Instance().

Here is the call graph for this function:

void Moses::TargetPhrase::SetAlignTerm ( const AlignmentInfo alignTerm  )  [inline]

bool Moses::TargetPhrase::SetData ( const std::string &  key,
boost::shared_ptr< void >  value 
) const [inline]

Definition at line 199 of file TargetPhrase.h.

Referenced by Moses::PhraseOrientationFeature::EvaluateInIsolation().

Here is the caller graph for this function:

void Moses::TargetPhrase::SetExtraScores ( FeatureFunction const *  ff,
boost::shared_ptr< Scores > const &  scores 
)

Definition at line 331 of file TargetPhrase.cpp.

Referenced by Moses::TranslationOption::CacheLexReorderingScores(), and Moses::PhraseDictionaryGroup::CreateTargetPhraseCollection().

Here is the caller graph for this function:

void Moses::TargetPhrase::SetProperties ( const StringPiece str  ) 

void Moses::TargetPhrase::SetProperty ( const std::string &  key,
const std::string &  value 
)

Definition at line 387 of file TargetPhrase.cpp.

References Moses::StaticData::GetPhrasePropertyFactory(), Moses::StaticData::Instance(), and Moses::PhrasePropertyFactory::ProduceProperty().

Referenced by SetProperties().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::TargetPhrase::SetRuleSource ( const Phrase ruleSource  )  const

void Moses::TargetPhrase::SetSparseScore ( const FeatureFunction translationScoreProducer,
const StringPiece sparseString 
)

void Moses::TargetPhrase::SetTargetLHS ( const Word lhs  )  [inline]

void Moses::TargetPhrase::SetXMLScore ( float  score  ) 

Definition at line 227 of file TargetPhrase.cpp.

References Moses::ScoreComponentCollection::Assign(), Moses::PhraseDictionary::GetColl(), and Moses::FeatureFunction::GetNumScoreComponents().

Referenced by Moses::ProcessAndStripXMLTags().

Here is the call graph for this function:

Here is the caller graph for this function:

Moses::TargetPhrase::TO_STRING (  ) 

Reimplemented from Moses::Phrase.

void Moses::TargetPhrase::UpdateScore ( ScoreComponentCollection futureScoreBreakdown = NULL  ) 

Definition at line 219 of file TargetPhrase.cpp.

References Moses::ScoreComponentCollection::GetWeightedScore().

Referenced by Moses::TranslationOption::UpdateScore().

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  ,
const TargetPhrase  
) [friend]

Definition at line 426 of file TargetPhrase.cpp.

void swap ( TargetPhrase first,
TargetPhrase second 
) [friend]

Definition at line 412 of file TargetPhrase.cpp.


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

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