Moses::TrellisPath Class Reference

#include <TrellisPath.h>

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 GetFutureScore () const
 get score for this path throught trellis
const std::vector< const
Hypothesis * > & 
GetEdges () const
size_t GetSize () 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 boost::shared_ptr
< ScoreComponentCollection
GetScoreBreakdown () const
Range 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 InitTotalScore ()
Manager const & manager () const

Protected Attributes

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

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. Used by phrase-based decoding

Definition at line 43 of file TrellisPath.h.


Constructor & Destructor Documentation

Moses::TrellisPath::TrellisPath ( const std::vector< const Hypothesis * >  edges  )  [explicit, 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::GetFutureScore(), Moses::Hypothesis::GetPrevHypo(), m_path, 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 58 of file TrellisPath.cpp.

References Moses::Hypothesis::GetPrevHypo(), InitTotalScore(), 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 128 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 89 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 87 of file TrellisPath.h.

References m_path.

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

Here is the caller graph for this function:

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

get score for this path throught trellis

Definition at line 80 of file TrellisPath.h.

References m_totalScore.

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

Here is the caller graph for this function:

boost::shared_ptr< ScoreComponentCollection > const Moses::TrellisPath::GetScoreBreakdown (  )  const

Definition at line 169 of file TrellisPath.cpp.

References Moses::Hypothesis::GetScoreBreakdown(), Moses::Hypothesis::GetWinningHypo(), m_path, and m_scoreBreakdown.

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

Here is the call graph for this function:

Here is the caller graph for this function:

size_t Moses::TrellisPath::GetSize (  )  const [inline]

Definition at line 91 of file TrellisPath.h.

References m_path.

Phrase Moses::TrellisPath::GetSurfacePhrase (  )  const

Definition at line 209 of file TrellisPath.cpp.

References Moses::Phrase::GetFactor(), Moses::Phrase::GetSize(), GetTargetPhrase(), manager(), NULL, Moses::BaseManager::options(), and UTIL_THROW_IF2.

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 193 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:

Range 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 229 of file TrellisPath.cpp.

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 43 of file TrellisPath.cpp.

References Moses::Hypothesis::GetFutureScore(), Moses::Hypothesis::GetWinningHypo(), m_path, and m_totalScore.

Referenced by TrellisPath().

Here is the call graph for this function:

Here is the caller graph for this function:

Manager const& Moses::TrellisPath::manager (  )  const [inline, protected]

Definition at line 63 of file TrellisPath.h.

References m_path, and UTIL_THROW_IF2.

Referenced by GetSurfacePhrase().

Here is the caller graph for this function:

Moses::TrellisPath::TO_STRING (  ) 


Friends And Related Function Documentation

friend class Manager [friend]

Definition at line 46 of file TrellisPath.h.

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

Definition at line 114 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 51 of file TrellisPath.h.

Referenced by CreateDeviantPaths().

boost::shared_ptr<ScoreComponentCollection> Moses::TrellisPath::m_scoreBreakdown [mutable, protected]

Definition at line 56 of file TrellisPath.h.

Referenced by GetScoreBreakdown().

Definition at line 55 of file TrellisPath.h.

Referenced by GetFutureScore(), InitTotalScore(), and TrellisPath().


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

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