Moses::TrellisPath Class Reference

#include <TrellisPath.h>

Collaboration diagram for Moses::TrellisPath:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 TrellisPath ()
 TrellisPath (const Hypothesis *hypo)
 create path OF pure hypo
 TrellisPath (const TrellisPath &copy, size_t edgeIndex, const Hypothesis *arc)
float GetTotalScore () const
 get score for this path throught trellis
const std::vector< const
Hypothesis * > & 
GetEdges () const
void CreateDeviantPaths (TrellisPathCollection &pathColl) const
 create a set of next best paths by wiggling 1 of the node at a time.
void CreateDeviantPaths (TrellisPathList &pathColl) const
 create a list of next best paths by wiggling 1 of the node at a time.
const ScoreComponentCollectionGetScoreBreakdown () const
WordsRange GetTargetWordsRange (const Hypothesis &hypo) const
 get target words range of the hypo within n-best trellis. not necessarily the same as hypo.GetCurrTargetWordsRange()
Phrase GetTargetPhrase () const
Phrase GetSurfacePhrase () const
 TO_STRING ()

Protected Member Functions

 TrellisPath (const std::vector< const Hypothesis * > edges)
void InitScore ()

Protected Attributes

std::vector< const Hypothesis * > m_path
size_t m_prevEdgeChanged
ScoreComponentCollection m_scoreBreakdown
float m_totalScore

Friends

class Manager
std::ostream & operator<< (std::ostream &, const TrellisPath &)


Detailed Description

Encapsulate the set of hypotheses/arcs that goes from decoding 1 phrase to all the source phrases to reach a final translation. For the best translation, this consist of all hypotheses, for the other n-best paths, the node on the path can consist of hypotheses or arcs

Definition at line 41 of file TrellisPath.h.


Constructor & Destructor Documentation

Moses::TrellisPath::TrellisPath ( const std::vector< const Hypothesis * >  edges  )  [protected]

Moses::TrellisPath::TrellisPath (  ) 

Referenced by CreateDeviantPaths().

Here is the caller graph for this function:

Moses::TrellisPath::TrellisPath ( const Hypothesis hypo  ) 

create path OF pure hypo

Definition at line 31 of file TrellisPath.cpp.

References Moses::Hypothesis::GetPrevHypo(), Moses::Hypothesis::GetScoreBreakdown(), Moses::Hypothesis::GetTotalScore(), m_path, m_scoreBreakdown, m_totalScore, and NULL.

Here is the call graph for this function:

Moses::TrellisPath::TrellisPath ( const TrellisPath copy,
size_t  edgeIndex,
const Hypothesis arc 
)

create path from another path, deviate at edgeIndex by using arc instead, which may change other hypo back from there

Definition at line 63 of file TrellisPath.cpp.

References Moses::Hypothesis::GetPrevHypo(), InitScore(), m_path, and NULL.

Here is the call graph for this function:


Member Function Documentation

void Moses::TrellisPath::CreateDeviantPaths ( TrellisPathList pathColl  )  const

create a list of next best paths by wiggling 1 of the node at a time.

Definition at line 135 of file TrellisPath.cpp.

References Moses::TrellisPathList::Add(), Moses::Hypothesis::GetArcList(), m_path, m_prevEdgeChanged, NOT_FOUND, and TrellisPath().

Here is the call graph for this function:

void Moses::TrellisPath::CreateDeviantPaths ( TrellisPathCollection pathColl  )  const

create a set of next best paths by wiggling 1 of the node at a time.

Definition at line 96 of file TrellisPath.cpp.

References Moses::TrellisPathCollection::Add(), Moses::Hypothesis::GetArcList(), m_path, m_prevEdgeChanged, NOT_FOUND, and TrellisPath().

Referenced by Moses::Manager::CalcNBest().

Here is the call graph for this function:

Here is the caller graph for this function:

const std::vector<const Hypothesis *>& Moses::TrellisPath::GetEdges (  )  const [inline]

list of each hypo/arcs in path. For anything other than the best hypo, it is not possible just to follow the m_prevHypo variable in the hypothesis object

Definition at line 80 of file TrellisPath.h.

References m_path.

Referenced by GetOutputFactors(), GetOutputWords(), LatticeMBRSolution::LatticeMBRSolution(), OutputAlignment(), OutputBestHypo(), and OutputNBest().

Here is the caller graph for this function:

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

Definition at line 90 of file TrellisPath.h.

References m_scoreBreakdown.

Referenced by doMBR(), Moses::operator<<(), and OutputNBest().

Here is the caller graph for this function:

Phrase Moses::TrellisPath::GetSurfacePhrase (  )  const

Definition at line 190 of file TrellisPath.cpp.

References Moses::Phrase::AddWord(), CHECK, Moses::Phrase::GetFactor(), Moses::StaticData::GetOutputFactorOrder(), Moses::Phrase::GetSize(), GetTargetPhrase(), and Moses::StaticData::Instance().

Referenced by Moses::Manager::CalcNBest().

Here is the call graph for this function:

Here is the caller graph for this function:

Phrase Moses::TrellisPath::GetTargetPhrase (  )  const

Definition at line 174 of file TrellisPath.cpp.

References Moses::Phrase::Append(), Moses::ARRAY_SIZE_INCR, Moses::Hypothesis::GetCurrTargetPhrase(), and m_path.

Referenced by GetSurfacePhrase().

Here is the call graph for this function:

Here is the caller graph for this function:

WordsRange Moses::TrellisPath::GetTargetWordsRange ( const Hypothesis hypo  )  const

get target words range of the hypo within n-best trellis. not necessarily the same as hypo.GetCurrTargetWordsRange()

Definition at line 209 of file TrellisPath.cpp.

References CHECK, Moses::Hypothesis::GetCurrTargetLength(), m_path, and NOT_FOUND.

Referenced by OutputNBest().

Here is the call graph for this function:

Here is the caller graph for this function:

float Moses::TrellisPath::GetTotalScore (  )  const [inline]

get score for this path throught trellis

Definition at line 73 of file TrellisPath.h.

References m_totalScore.

Referenced by LatticeMBRSolution::LatticeMBRSolution(), Moses::CompareTrellisPathCollection::operator()(), Moses::operator<<(), and OutputNBest().

Here is the caller graph for this function:

void Moses::TrellisPath::InitScore (  )  [protected]

Moses::TrellisPath::TO_STRING (  ) 


Friends And Related Function Documentation

friend class Manager [friend]

Definition at line 44 of file TrellisPath.h.

std::ostream& operator<< ( std::ostream &  out,
const TrellisPath path 
) [friend]

Definition at line 105 of file TrellisPath.h.


Member Data Documentation

std::vector<const Hypothesis *> Moses::TrellisPath::m_path [protected]

the last node that was wiggled to create this path , or NOT_FOUND if this path is the best trans so consist of only hypos

Definition at line 48 of file TrellisPath.h.

Referenced by CreateDeviantPaths().

Definition at line 52 of file TrellisPath.h.

Referenced by GetScoreBreakdown(), InitScore(), and TrellisPath().

Definition at line 53 of file TrellisPath.h.

Referenced by GetTotalScore(), InitScore(), and TrellisPath().


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

Generated on Wed Feb 8 22:04:10 2012 for Moses by  doxygen 1.5.9