#include <TrellisPath.h>
Public Member Functions | |
TrellisPath () | |
TrellisPath (const Hypothesis *hypo) | |
create path OF pure hypo | |
TrellisPath (const TrellisPath ©, 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 &) |
Definition at line 43 of file TrellisPath.h.
Moses::TrellisPath::TrellisPath | ( | const std::vector< const Hypothesis * > | edges | ) | [explicit, protected] |
Moses::TrellisPath::TrellisPath | ( | ) |
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.
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.
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().
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().
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().
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().
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().
size_t Moses::TrellisPath::GetSize | ( | ) | const [inline] |
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().
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().
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().
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().
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().
Moses::TrellisPath::TO_STRING | ( | ) |
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.
std::vector<const Hypothesis *> Moses::TrellisPath::m_path [protected] |
Definition at line 49 of file TrellisPath.h.
Referenced by CreateDeviantPaths(), GetEdges(), GetScoreBreakdown(), GetSize(), GetTargetPhrase(), GetTargetWordsRange(), InitTotalScore(), manager(), Moses::operator<<(), and TrellisPath().
size_t Moses::TrellisPath::m_prevEdgeChanged [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] |
float Moses::TrellisPath::m_totalScore [protected] |
Definition at line 55 of file TrellisPath.h.
Referenced by GetFutureScore(), InitTotalScore(), and TrellisPath().