Moses::ChartHypothesis Class Reference

#include <ChartHypothesis.h>

Collaboration diagram for Moses::ChartHypothesis:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ChartHypothesis (const ChartTranslationOptions &, const RuleCubeItem &item, ChartManager &manager)
 ChartHypothesis (const ChartHypothesis &, const ChartKBestExtractor &)
 only used by ChartKBestExtractor
 ~ChartHypothesis ()
unsigned GetId () const
const ChartTranslationOptionGetTranslationOption () const
const TargetPhraseGetCurrTargetPhrase () const
 Get the rule that created this hypothesis.
const RangeGetCurrSourceRange () const
 the source range that this hypothesis spans
const ChartArcListGetArcList () const
 the arc list when creating n-best lists
const FFStateGetFFState (size_t featureID) const
 the feature function states for a particular feature
const ChartManagerGetManager () const
 reference back to the manager
void GetOutputPhrase (Phrase &outPhrase) const
Phrase GetOutputPhrase () const
void GetOutputPhrase (size_t leftRightMost, size_t numWords, Phrase &outPhrase) const
void EvaluateWhenApplied ()
void AddArc (ChartHypothesis *loserHypo)
void CleanupArcList ()
void SetWinningHypo (const ChartHypothesis *hypo)
const ScoreComponentCollectionGetScoreBreakdown () const
 get the unweighted score for each feature function
const ScoreComponentCollectionGetDeltaScoreBreakdown () const
 get the unweighted score delta for each feature function
float GetFutureScore () const
 Get the weighted total score.
const std::vector< const
ChartHypothesis * > & 
GetPrevHypos () const
 vector of previous hypotheses this hypo is built on
const ChartHypothesisGetPrevHypo (size_t pos) const
 get a particular previous hypos
const WordGetTargetLHS () const
 get the constituency label that covers this hypo
const ChartHypothesisGetWinningHypothesis () const
 get the best hypo in the arc list when doing n-best list creation. It's either this hypothesis, or the best hypo is this hypo is in the arc list
size_t hash () const
bool operator== (const ChartHypothesis &other) const
 TO_STRING ()

Protected Member Functions

 ChartHypothesis ()
 not implemented
 ChartHypothesis (const ChartHypothesis &copy)
 not implemented

Protected Attributes

boost::shared_ptr
< ChartTranslationOption
m_transOpt
Range m_currSourceWordsRange
std::vector< const FFState * > m_ffStates
boost::scoped_ptr
< ScoreComponentCollection
m_scoreBreakdown
boost::scoped_ptr
< ScoreComponentCollection
m_deltaScoreBreakdown
ScoreComponentCollection m_currScoreBreakdown
ScoreComponentCollection m_lmNGram
ScoreComponentCollection m_lmPrefix
float m_totalScore
ChartArcListm_arcList
const ChartHypothesism_winningHypo
std::vector< const
ChartHypothesis * > 
m_prevHypos
ChartManagerm_manager
unsigned m_id

Friends

std::ostream & operator<< (std::ostream &, const ChartHypothesis &)


Detailed Description

a hypothesis in the hierarchical/syntax decoder. Contain a pointer to the current target phrase, a vector of previous hypos, and some scores

Definition at line 46 of file ChartHypothesis.h.


Constructor & Destructor Documentation

Moses::ChartHypothesis::ChartHypothesis (  )  [protected]

not implemented

Moses::ChartHypothesis::ChartHypothesis ( const ChartHypothesis copy  )  [protected]

not implemented

Moses::ChartHypothesis::ChartHypothesis ( const ChartTranslationOptions transOpt,
const RuleCubeItem item,
ChartManager manager 
)

Create a hypothesis from a rule

Parameters:
transOpt wrapper around the rule
item 
Todo:
dunno
Parameters:
manager reference back to manager

Definition at line 45 of file ChartHypothesis.cpp.

References Moses::RuleCubeItem::GetHypothesisDimensions(), and m_prevHypos.

Here is the call graph for this function:

Moses::ChartHypothesis::ChartHypothesis ( const ChartHypothesis pred,
const ChartKBestExtractor  
)

only used by ChartKBestExtractor

Definition at line 67 of file ChartHypothesis.cpp.

References m_prevHypos.

Moses::ChartHypothesis::~ChartHypothesis (  ) 

Definition at line 80 of file ChartHypothesis.cpp.

References m_arcList, and m_ffStates.


Member Function Documentation

void Moses::ChartHypothesis::AddArc ( ChartHypothesis loserHypo  ) 

Definition at line 214 of file ChartHypothesis.cpp.

References m_arcList.

Referenced by Moses::ChartHypothesisCollection::AddHypothesis().

Here is the caller graph for this function:

void Moses::ChartHypothesis::CleanupArcList (  ) 

void Moses::ChartHypothesis::EvaluateWhenApplied (  ) 

const ChartArcList* Moses::ChartHypothesis::GetArcList (  )  const [inline]

the arc list when creating n-best lists

Definition at line 108 of file ChartHypothesis.h.

References m_arcList.

const Range& Moses::ChartHypothesis::GetCurrSourceRange (  )  const [inline]

const TargetPhrase& Moses::ChartHypothesis::GetCurrTargetPhrase (  )  const [inline]

const ScoreComponentCollection& Moses::ChartHypothesis::GetDeltaScoreBreakdown (  )  const [inline]

get the unweighted score delta for each feature function

Definition at line 155 of file ChartHypothesis.h.

References GetTranslationOption(), m_currScoreBreakdown, m_deltaScoreBreakdown, and m_transOpt.

Referenced by Moses::ChartKBestExtractor::GetOutputScoreBreakdown().

Here is the call graph for this function:

Here is the caller graph for this function:

const FFState* Moses::ChartHypothesis::GetFFState ( size_t  featureID  )  const [inline]

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

unsigned Moses::ChartHypothesis::GetId (  )  const [inline]

Definition at line 89 of file ChartHypothesis.h.

References m_id.

Referenced by Moses::ChartHypothesisCollection::AddHypothesis(), Moses::operator<<(), and Moses::ChartHypothesisCollection::PruneToSize().

Here is the caller graph for this function:

const ChartManager& Moses::ChartHypothesis::GetManager (  )  const [inline]

void Moses::ChartHypothesis::GetOutputPhrase ( size_t  leftRightMost,
size_t  numWords,
Phrase outPhrase 
) const

Phrase Moses::ChartHypothesis::GetOutputPhrase (  )  const

Return full output phrase

Definition at line 140 of file ChartHypothesis.cpp.

References Moses::ARRAY_SIZE_INCR.

void Moses::ChartHypothesis::GetOutputPhrase ( Phrase outPhrase  )  const

const ChartHypothesis* Moses::ChartHypothesis::GetPrevHypo ( size_t  pos  )  const [inline]

const std::vector<const ChartHypothesis*>& Moses::ChartHypothesis::GetPrevHypos (  )  const [inline]

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

get the unweighted score for each feature function

Definition at line 136 of file ChartHypothesis.h.

References GetScoreBreakdown(), GetTranslationOption(), m_currScoreBreakdown, m_prevHypos, m_scoreBreakdown, and m_transOpt.

Referenced by Moses::BilingualLM::EvaluateWhenApplied(), and GetScoreBreakdown().

Here is the call graph for this function:

Here is the caller graph for this function:

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

get the constituency label that covers this hypo

Definition at line 186 of file ChartHypothesis.h.

References GetCurrTargetPhrase(), and Moses::TargetPhrase::GetTargetLHS().

Referenced by Moses::ChartCell::AddHypothesis(), and Moses::SoftMatchingFeature::EvaluateWhenApplied().

Here is the call graph for this function:

Here is the caller graph for this function:

const ChartTranslationOption& Moses::ChartHypothesis::GetTranslationOption (  )  const [inline]

const ChartHypothesis* Moses::ChartHypothesis::GetWinningHypothesis (  )  const [inline]

get the best hypo in the arc list when doing n-best list creation. It's either this hypothesis, or the best hypo is this hypo is in the arc list

Definition at line 191 of file ChartHypothesis.h.

References m_winningHypo.

size_t Moses::ChartHypothesis::hash (  )  const

Definition at line 298 of file ChartHypothesis.cpp.

References Moses::FFState::hash(), m_ffStates, and state.

Here is the call graph for this function:

bool Moses::ChartHypothesis::operator== ( const ChartHypothesis other  )  const

Definition at line 312 of file ChartHypothesis.cpp.

References m_ffStates.

void Moses::ChartHypothesis::SetWinningHypo ( const ChartHypothesis hypo  ) 

Definition at line 293 of file ChartHypothesis.cpp.

References m_winningHypo.

Referenced by CleanupArcList().

Here is the caller graph for this function:

Moses::ChartHypothesis::TO_STRING (  ) 


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const ChartHypothesis hypo 
) [friend]

Definition at line 328 of file ChartHypothesis.cpp.


Member Data Documentation

Definition at line 65 of file ChartHypothesis.h.

Referenced by AddArc(), CleanupArcList(), GetArcList(), and ~ChartHypothesis().

scores for this hypothesis only

Definition at line 61 of file ChartHypothesis.h.

Referenced by EvaluateWhenApplied(), GetDeltaScoreBreakdown(), and GetScoreBreakdown().

Definition at line 55 of file ChartHypothesis.h.

Referenced by GetCurrSourceRange().

Definition at line 59 of file ChartHypothesis.h.

Referenced by GetDeltaScoreBreakdown().

std::vector<const FFState*> Moses::ChartHypothesis::m_ffStates [protected]

Definition at line 56 of file ChartHypothesis.h.

Referenced by EvaluateWhenApplied(), GetFFState(), hash(), operator==(), and ~ChartHypothesis().

unsigned Moses::ChartHypothesis::m_id [protected]

Definition at line 72 of file ChartHypothesis.h.

Referenced by GetId().

Definition at line 61 of file ChartHypothesis.h.

Definition at line 61 of file ChartHypothesis.h.

Definition at line 70 of file ChartHypothesis.h.

Referenced by GetManager().

std::vector<const ChartHypothesis*> Moses::ChartHypothesis::m_prevHypos [protected]

boost::scoped_ptr<ScoreComponentCollection> Moses::ChartHypothesis::m_scoreBreakdown [mutable, protected]

stateful feature function states

sum of scores of this hypothesis, and previous hypotheses. Lazily initialised.

Definition at line 58 of file ChartHypothesis.h.

Referenced by GetScoreBreakdown().

Definition at line 63 of file ChartHypothesis.h.

Referenced by EvaluateWhenApplied(), and GetFutureScore().

all arcs that end at the same trellis point as this hypothesis

Definition at line 66 of file ChartHypothesis.h.

Referenced by CleanupArcList(), GetWinningHypothesis(), and SetWinningHypo().


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

Generated on Thu Jul 6 00:32:54 2017 for Moses by  doxygen 1.5.9