#include <Hypothesis.h>
Public Member Functions | |
Hypothesis (Manager &manager, InputType const &source, const TranslationOption &initialTransOpt, const Bitmap &bitmap, int id) | |
Hypothesis (const Hypothesis &prevHypo, const TranslationOption &transOpt, const Bitmap &bitmap, int id) | |
~Hypothesis () | |
void | PrintHypothesis () const |
const InputType & | GetInput () const |
const TargetPhrase & | GetCurrTargetPhrase () const |
const Range & | GetCurrSourceWordsRange () const |
const Range & | GetCurrTargetWordsRange () const |
Manager & | GetManager () const |
size_t | GetCurrTargetLength () const |
void | EvaluateWhenApplied (float estimatedScore) |
int | GetId () const |
const Hypothesis * | GetPrevHypo () const |
size_t | GetSize () const |
std::string | GetSourcePhraseStringRep (const std::vector< FactorType > factorsToPrint) const |
std::string | GetTargetPhraseStringRep (const std::vector< FactorType > factorsToPrint) const |
std::string | GetSourcePhraseStringRep () const |
std::string | GetTargetPhraseStringRep () const |
const Word & | GetCurrWord (size_t pos) const |
const Factor * | GetCurrFactor (size_t pos, FactorType factorType) const |
const Word & | GetWord (size_t pos) const |
const Factor * | GetFactor (size_t pos, FactorType factorType) const |
const Bitmap & | GetWordsBitmap () const |
bool | IsSourceCompleted () const |
void | GetOutputPhrase (Phrase &out) const |
void | ToStream (std::ostream &out) const |
void | ToStringStream (std::stringstream &out) const |
std::string | GetOutputString () const |
TO_STRING () | |
void | SetWinningHypo (const Hypothesis *hypo) |
const Hypothesis * | GetWinningHypo () const |
void | AddArc (Hypothesis *loserHypo) |
void | CleanupArcList (size_t nBestSize, bool distinctNBest) |
const ArcList * | GetArcList () const |
returns a list alternative previous hypotheses (or NULL if n-best support is disabled) | |
const ScoreComponentCollection & | GetScoreBreakdown () const |
float | GetFutureScore () const |
float | GetScore () const |
const FFState * | GetFFState (int idx) const |
void | SetFFState (int idx, FFState *state) |
std::vector< std::vector < unsigned int > > * | GetLMStats () const |
const TranslationOption & | GetTranslationOption () const |
size_t | OutputAlignment (std::ostream &out, bool recursive) const |
void | OutputInput (std::ostream &os) const |
std::map< size_t, const Moses::Factor * > | GetPlaceholders (const Moses::Hypothesis &hypo, Moses::FactorType placeholderFactor) const |
size_t | hash () const |
bool | operator== (const Hypothesis &other) const |
bool | beats (Hypothesis const &b) const |
Static Public Member Functions | |
static void | OutputInput (std::vector< const Phrase * > &map, const Hypothesis *hypo) |
Protected Attributes | |
const Hypothesis * | m_prevHypo |
const Bitmap & | m_sourceCompleted |
InputType const & | m_sourceInput |
Range | m_currSourceWordsRange |
Range | m_currTargetWordsRange |
bool | m_wordDeleted |
float | m_futureScore |
float | m_estimatedScore |
boost::scoped_ptr < ScoreComponentCollection > | m_scoreBreakdown |
ScoreComponentCollection | m_currScoreBreakdown |
std::vector< const FFState * > | m_ffStates |
const Hypothesis * | m_winningHypo |
ArcList * | m_arcList |
const TranslationOption & | m_transOpt |
Manager & | m_manager |
int | m_id |
Friends | |
std::ostream & | operator<< (std::ostream &, const Hypothesis &) |
The expansion of hypotheses is handled in the class Manager, which stores active hypothesis in the search in hypothesis stacks.
Definition at line 65 of file Hypothesis.h.
Moses::Hypothesis::Hypothesis | ( | Manager & | manager, | |
InputType const & | source, | |||
const TranslationOption & | initialTransOpt, | |||
const Bitmap & | bitmap, | |||
int | id | |||
) |
numeric ID of this hypothesis, used for logging
used by initial seeding of the translation process
Definition at line 49 of file Hypothesis.cpp.
References Moses::StatefulFeatureFunction::GetStatefulFeatureFunctions(), and m_ffStates.
Moses::Hypothesis::Hypothesis | ( | const Hypothesis & | prevHypo, | |
const TranslationOption & | transOpt, | |||
const Bitmap & | bitmap, | |||
int | id | |||
) |
used when creating a new hypothesis using a translation option (phrase translation)
Definition at line 80 of file Hypothesis.cpp.
References Moses::TranslationOption::GetScoreBreakdown(), Moses::TranslationOption::IsDeletionOption(), m_currScoreBreakdown, m_wordDeleted, and Moses::ScoreComponentCollection::PlusEquals().
Moses::Hypothesis::~Hypothesis | ( | ) |
void Moses::Hypothesis::AddArc | ( | Hypothesis * | loserHypo | ) |
Definition at line 123 of file Hypothesis.cpp.
References m_arcList.
Referenced by Moses::HypothesisStackNormal::AddPrune(), and Moses::HypothesisStackCubePruning::AddPrune().
bool Moses::Hypothesis::beats | ( | Hypothesis const & | b | ) | const |
Definition at line 444 of file Hypothesis.cpp.
References beats(), m_estimatedScore, m_futureScore, and m_prevHypo.
Referenced by beats(), and Moses::CompareHypothesisTotalScore::operator()().
void Moses::Hypothesis::CleanupArcList | ( | size_t | nBestSize, | |
bool | distinctNBest | |||
) |
Definition at line 237 of file Hypothesis.cpp.
References m_arcList, NTH_ELEMENT4, and SetWinningHypo().
Referenced by Moses::HypothesisStackNormal::CleanupArcList(), and Moses::HypothesisStackCubePruning::CleanupArcList().
void Moses::Hypothesis::EvaluateWhenApplied | ( | float | estimatedScore | ) |
Definition at line 152 of file Hypothesis.cpp.
References Moses::StatefulFeatureFunction::EvaluateWhenApplied(), Moses::StatelessFeatureFunction::EvaluateWhenApplied(), GetScore(), Moses::StatefulFeatureFunction::GetStatefulFeatureFunctions(), Moses::StatelessFeatureFunction::GetStatelessFeatureFunctions(), Moses::ScoreComponentCollection::GetWeightedScore(), Moses::StaticData::Instance(), Moses::StaticData::IsFeatureFunctionIgnored(), m_currScoreBreakdown, m_estimatedScore, m_ffStates, m_futureScore, m_prevHypo, and NULL.
Referenced by Moses::SearchNormal::ExpandHypothesis().
const ArcList* Moses::Hypothesis::GetArcList | ( | ) | const [inline] |
returns a list alternative previous hypotheses (or NULL if n-best support is disabled)
Definition at line 208 of file Hypothesis.h.
References m_arcList.
Referenced by Moses::TrellisPath::CreateDeviantPaths(), Moses::Manager::GetConnectedGraph(), Moses::Manager::GetWinnerConnectedGraph(), Moses::Manager::GetWordGraph(), and Moses::pruneLatticeFB().
const Factor* Moses::Hypothesis::GetCurrFactor | ( | size_t | pos, | |
FactorType | factorType | |||
) | const [inline] |
Definition at line 147 of file Hypothesis.h.
References GetCurrTargetPhrase(), and Moses::Phrase::GetFactor().
const Range& Moses::Hypothesis::GetCurrSourceWordsRange | ( | ) | const [inline] |
return input positions covered by the translation option (phrasal translation) used to create this hypothesis
Definition at line 106 of file Hypothesis.h.
References m_currSourceWordsRange.
Referenced by Moses::SentenceStats::AddDeletedWords(), Moses::BackwardsEdge::BackwardsEdge(), Moses::Manager::CalcDecoderStatistics(), Moses::BilingualLM::EvaluateWhenApplied(), Moses::OpSequenceModel::EvaluateWhenApplied(), Moses::DesegModel::EvaluateWhenApplied(), Moses::DistortionScoreProducer::EvaluateWhenApplied(), Moses::SearchNormal::ExpandAllHypotheses(), Moses::HypothesisScoreOrdererWithDistortion::operator()(), Moses::operator<<(), Moses::Manager::OutputAlignment(), OutputAlignment(), Moses::Manager::OutputInput(), OutputInput(), Moses::Manager::OutputNBest(), Moses::OutputSearchNode(), Moses::Manager::OutputSurface(), and Moses::SearchNormal::ProcessOneHypothesis().
size_t Moses::Hypothesis::GetCurrTargetLength | ( | ) | const [inline] |
output length of the translation option used to create this hypothesis
Definition at line 119 of file Hypothesis.h.
References Moses::Range::GetNumWordsCovered(), and m_currTargetWordsRange.
Referenced by Moses::BackwardLanguageModel< Model >::Evaluate(), Moses::LanguageModelKen< Model >::EvaluateWhenApplied(), Moses::LanguageModelIRST::EvaluateWhenApplied(), Moses::LanguageModelImplementation::EvaluateWhenApplied(), Moses::LanguageModelDALM::EvaluateWhenApplied(), Moses::DesegModel::EvaluateWhenApplied(), Moses::BleuScoreFeature::EvaluateWhenApplied(), and Moses::TrellisPath::GetTargetWordsRange().
TargetPhrase const & Moses::Hypothesis::GetCurrTargetPhrase | ( | ) | const |
return target phrase used to create this hypothesis
Definition at line 270 of file Hypothesis.cpp.
References Moses::TranslationOption::GetTargetPhrase(), and m_transOpt.
Referenced by Moses::Manager::CalcDecoderStatistics(), Moses::BitmapContainer::Enqueue(), Moses::BackwardLanguageModel< Model >::Evaluate(), Moses::BilingualLM::EvaluateWhenApplied(), Moses::TargetNgramFeature::EvaluateWhenApplied(), Moses::TargetConstituentAdjacencyFeature::EvaluateWhenApplied(), Moses::TargetBigramFeature::EvaluateWhenApplied(), Moses::PhraseBoundaryFeature::EvaluateWhenApplied(), Moses::OpSequenceModel::EvaluateWhenApplied(), Moses::GlobalLexicalModelUnlimited::EvaluateWhenApplied(), Moses::DesegModel::EvaluateWhenApplied(), Moses::DistortionScoreProducer::EvaluateWhenApplied(), Moses::CoveredReferenceFeature::EvaluateWhenApplied(), Moses::BleuScoreFeature::EvaluateWhenApplied(), GetCurrFactor(), GetCurrWord(), GetOutputFactors(), GetOutputPhrase(), Moses::GetOutputWords(), Moses::TrellisPath::GetTargetPhrase(), Moses::LatticeMBRSolution::LatticeMBRSolution(), Moses::HypothesisScoreOrderer::operator()(), Moses::HypothesisScoreOrdererWithDistortion::operator()(), Moses::Manager::OutputAlignment(), OutputAlignment(), Moses::Manager::OutputNBest(), Moses::Manager::OutputSearchGraphAsHypergraph(), Moses::Manager::OutputSearchGraphAsSLF(), Moses::OutputSearchNode(), Moses::Manager::OutputSurface(), Moses::Manager::OutputWordGraph(), PrintHypothesis(), Moses::pruneLatticeFB(), ToStringStream(), and Moses::VWState::VWState().
const Range& Moses::Hypothesis::GetCurrTargetWordsRange | ( | ) | const [inline] |
Definition at line 110 of file Hypothesis.h.
References m_currTargetWordsRange.
Referenced by Moses::SentenceStats::AddDeletedWords(), Moses::LanguageModelKen< Model >::EvaluateWhenApplied(), Moses::LanguageModelIRST::EvaluateWhenApplied(), Moses::LanguageModelImplementation::EvaluateWhenApplied(), Moses::LanguageModelDALM::EvaluateWhenApplied(), and GetWord().
const Word& Moses::Hypothesis::GetCurrWord | ( | size_t | pos | ) | const [inline] |
curr - pos is relative from CURRENT hypothesis's starting index (ie, start of sentence would be some negative number, which is not allowed- USE WITH CAUTION)
Definition at line 144 of file Hypothesis.h.
References GetCurrTargetPhrase(), and Moses::Phrase::GetWord().
Referenced by GetWord().
const Factor* Moses::Hypothesis::GetFactor | ( | size_t | pos, | |
FactorType | factorType | |||
) | const [inline] |
Definition at line 159 of file Hypothesis.h.
References GetWord().
const FFState* Moses::Hypothesis::GetFFState | ( | int | idx | ) | const [inline] |
float Moses::Hypothesis::GetFutureScore | ( | ) | const [inline] |
Definition at line 221 of file Hypothesis.h.
References m_futureScore.
Referenced by Moses::HypothesisStackNormal::Add(), Moses::HypothesisStackCubePruning::Add(), Moses::HypothesisStackNormal::AddPrune(), Moses::HypothesisStackCubePruning::AddPrune(), Moses::SentenceStats::AddRecombination(), Moses::HypothesisStackNormal::GetBestHypothesis(), Moses::HypothesisStackCubePruning::GetBestHypothesis(), Moses::TrellisPath::InitTotalScore(), Moses::BitmapContainerOrderer::operator()(), Moses::HypothesisScoreOrderer::operator()(), Moses::QueueItemOrderer::operator()(), Moses::Manager::OutputBest(), Moses::BitmapContainer::ProcessBestHypothesis(), Moses::HypothesisStackNormal::PruneToSize(), Moses::HypothesisStackCubePruning::PruneToSize(), and Moses::TrellisPath::TrellisPath().
int Moses::Hypothesis::GetId | ( | ) | const [inline] |
Definition at line 125 of file Hypothesis.h.
References m_id.
Referenced by Moses::HypothesisStackNormal::AddPrune(), Moses::Manager::CalcLatticeSamples(), Moses::calcNgramExpectations(), Moses::Manager::GetConnectedGraph(), Moses::Manager::GetWinnerConnectedGraph(), Moses::SGNReverseCompare::operator()(), Moses::SearchGraphNode::operator<(), Moses::Edge::operator<(), Moses::operator<<(), Moses::Manager::OutputSearchGraphAsHypergraph(), Moses::Manager::OutputSearchGraphAsSLF(), Moses::OutputSearchNode(), Moses::Manager::OutputWordGraph(), Moses::pruneLatticeFB(), Moses::HypothesisStackNormal::PruneToSize(), and Moses::HypothesisStackCubePruning::PruneToSize().
const InputType& Moses::Hypothesis::GetInput | ( | ) | const [inline] |
Definition at line 97 of file Hypothesis.h.
References m_sourceInput.
Referenced by Moses::Manager::CalcDecoderStatistics(), Moses::DistortionScoreProducer::CalculateDistortionScore(), Moses::LexicalReordering::EvaluateWhenApplied(), Moses::DistortionScoreProducer::EvaluateWhenApplied(), Moses::Manager::OutputInput(), and OutputInput().
std::vector<std::vector<unsigned int> >* Moses::Hypothesis::GetLMStats | ( | ) | const [inline] |
Manager& Moses::Hypothesis::GetManager | ( | ) | const [inline] |
Definition at line 114 of file Hypothesis.h.
References m_manager.
Referenced by Moses::DistortionScoreProducer::CalculateDistortionScore(), Moses::LanguageModelImplementation::EvaluateWhenApplied(), Moses::BilingualLM::EvaluateWhenApplied(), Moses::VW::EvaluateWhenApplied(), Moses::OpSequenceModel::EvaluateWhenApplied(), Moses::CoveredReferenceFeature::EvaluateWhenApplied(), and Moses::Manager::OutputPassthroughInformation().
void Moses::Hypothesis::GetOutputPhrase | ( | Phrase & | out | ) | const |
Definition at line 277 of file Hypothesis.cpp.
References Moses::Phrase::Append(), GetCurrTargetPhrase(), GetOutputPhrase(), m_prevHypo, and NULL.
Referenced by Moses::ConstrainedDecodingState::ConstrainedDecodingState(), Moses::ControlRecombinationState::ControlRecombinationState(), Moses::Manager::GetOutputLanguageModelOrder(), GetOutputPhrase(), and ToStream().
std::string Moses::Hypothesis::GetOutputString | ( | ) | const [inline] |
Definition at line 189 of file Hypothesis.h.
References ToStringStream().
std::map< size_t, const Factor * > Moses::Hypothesis::GetPlaceholders | ( | const Moses::Hypothesis & | hypo, | |
Moses::FactorType | placeholderFactor | |||
) | const |
Definition at line 381 of file Hypothesis.cpp.
References Moses::AlignmentInfo::GetAlignmentsForSource(), Moses::TargetPhrase::GetAlignTerm(), Moses::Phrase::GetFactor(), Moses::TranslationOption::GetInputPath(), Moses::InputPath::GetPhrase(), Moses::Phrase::GetSize(), Moses::TranslationOption::GetTargetPhrase(), GetTranslationOption(), and UTIL_THROW_IF2.
const Hypothesis * Moses::Hypothesis::GetPrevHypo | ( | ) | const |
Definition at line 190 of file Hypothesis.cpp.
References m_prevHypo.
Referenced by Moses::SentenceStats::AddDeletedWords(), Moses::Manager::CalcDecoderStatistics(), Moses::Manager::CalcLatticeSamples(), Moses::TargetConstituentAdjacencyFeature::EvaluateWhenApplied(), Moses::Manager::GetConnectedGraph(), Moses::Manager::GetWinnerConnectedGraph(), GetWord(), operator<<(), Moses::Manager::OutputAlignment(), Moses::Manager::OutputInput(), OutputInput(), Moses::Manager::OutputSearchGraphAsHypergraph(), Moses::Manager::OutputSearchGraphAsSLF(), Moses::OutputSearchNode(), Moses::Manager::OutputSurface(), Moses::Manager::OutputWordGraph(), TranslationAnalysis::PrintTranslationAnalysis(), Moses::pruneLatticeFB(), Moses::TrellisPath::TrellisPath(), and MosesTest::MockHypothesisGuard::~MockHypothesisGuard().
float Moses::Hypothesis::GetScore | ( | ) | const [inline] |
Definition at line 224 of file Hypothesis.h.
References m_estimatedScore, and m_futureScore.
Referenced by Moses::Manager::CalcLatticeSamples(), EvaluateWhenApplied(), Moses::SearchNormal::ExpandAllHypotheses(), Moses::HypothesisScoreOrdererWithDistortion::operator()(), Moses::HypothesisScoreOrdererNoDistortion::operator()(), Moses::OutputSearchNode(), Moses::Manager::OutputSurface(), and Moses::pruneLatticeFB().
const ScoreComponentCollection& Moses::Hypothesis::GetScoreBreakdown | ( | ) | const [inline] |
Definition at line 211 of file Hypothesis.h.
References GetScoreBreakdown(), m_currScoreBreakdown, m_prevHypo, and m_scoreBreakdown.
Referenced by Moses::TrellisPath::GetScoreBreakdown(), GetScoreBreakdown(), Moses::OutputSearchNode(), Moses::Manager::OutputSurface(), and Moses::Manager::OutputWordGraph().
size_t Moses::Hypothesis::GetSize | ( | ) | const [inline] |
length of the partial translation (from the start of the sentence)
Definition at line 132 of file Hypothesis.h.
References Moses::Range::GetEndPos(), and m_currTargetWordsRange.
Referenced by Moses::LanguageModelImplementation::EvaluateWhenApplied(), Moses::TargetNgramFeature::EvaluateWhenApplied(), Moses::GlobalLexicalModelUnlimited::EvaluateWhenApplied(), and Moses::pruneLatticeFB().
std::string Moses::Hypothesis::GetSourcePhraseStringRep | ( | ) | const |
Definition at line 322 of file Hypothesis.cpp.
std::string Moses::Hypothesis::GetSourcePhraseStringRep | ( | const std::vector< FactorType > | factorsToPrint | ) | const |
Referenced by Moses::OutputSearchNode(), and Moses::Manager::OutputWordGraph().
std::string Moses::Hypothesis::GetTargetPhraseStringRep | ( | ) | const |
Definition at line 332 of file Hypothesis.cpp.
std::string Moses::Hypothesis::GetTargetPhraseStringRep | ( | const std::vector< FactorType > | factorsToPrint | ) | const |
const TranslationOption& Moses::Hypothesis::GetTranslationOption | ( | ) | const [inline] |
Definition at line 238 of file Hypothesis.h.
References m_transOpt.
Referenced by Moses::SentenceStats::AddDeletedWords(), Moses::VW::EvaluateWhenApplied(), Moses::PhraseBoundaryFeature::EvaluateWhenApplied(), Moses::LexicalReordering::EvaluateWhenApplied(), Moses::Manager::GetPlaceholders(), GetPlaceholders(), Moses::Manager::OutputInput(), OutputInput(), and Moses::VWState::VWState().
const Hypothesis* Moses::Hypothesis::GetWinningHypo | ( | ) | const [inline] |
Definition at line 200 of file Hypothesis.h.
References m_winningHypo.
Referenced by Moses::TrellisPath::GetScoreBreakdown(), and Moses::TrellisPath::InitTotalScore().
const Word& Moses::Hypothesis::GetWord | ( | size_t | pos | ) | const [inline] |
recursive - pos is relative from start of sentence
Definition at line 151 of file Hypothesis.h.
References GetCurrTargetWordsRange(), GetCurrWord(), GetPrevHypo(), Moses::Range::GetStartPos(), NULL, and UTIL_THROW_IF2.
Referenced by Moses::LanguageModelKen< Model >::EvaluateWhenApplied(), Moses::LanguageModelIRST::EvaluateWhenApplied(), Moses::LanguageModelImplementation::EvaluateWhenApplied(), Moses::LanguageModelDALM::EvaluateWhenApplied(), Moses::TargetNgramFeature::EvaluateWhenApplied(), Moses::GlobalLexicalModelUnlimited::EvaluateWhenApplied(), and GetFactor().
const Bitmap& Moses::Hypothesis::GetWordsBitmap | ( | ) | const [inline] |
Definition at line 166 of file Hypothesis.h.
References m_sourceCompleted.
Referenced by Moses::HypothesisStackNormal::Add(), Moses::HypothesisStackCubePruning::AddHypothesesToBitmapContainers(), Moses::HypothesisStackCubePruning::AddInitial(), Moses::HypothesisStackNormal::AddPrune(), Moses::SentenceStats::AddRecombination(), Moses::ascendingCoverageCmp(), Moses::BackwardsEdge::BackwardsEdge(), Moses::calcNgramExpectations(), Moses::TargetNgramFeature::EvaluateWhenApplied(), Moses::TargetBigramFeature::EvaluateWhenApplied(), Moses::OpSequenceModel::EvaluateWhenApplied(), Moses::DistortionScoreProducer::EvaluateWhenApplied(), Moses::BleuScoreFeature::EvaluateWhenApplied(), Moses::SearchNormal::ExpandAllHypotheses(), Moses::SearchNormal::ExpandHypothesis(), Moses::HypothesisScoreOrdererWithDistortion::operator()(), Moses::Manager::OutputSearchGraphAsHypergraph(), Moses::OutputSearchNode(), Moses::TranslationOption::Overlap(), Moses::SearchNormal::ProcessOneHypothesis(), and Moses::HypothesisStackNormal::PruneToSize().
size_t Moses::Hypothesis::hash | ( | ) | const |
Definition at line 401 of file Hypothesis.cpp.
References Moses::FFState::hash(), Moses::Bitmap::hash(), m_ffStates, m_sourceCompleted, and state.
bool Moses::Hypothesis::IsSourceCompleted | ( | ) | const [inline] |
Definition at line 170 of file Hypothesis.h.
References Moses::Bitmap::IsComplete(), and m_sourceCompleted.
Referenced by Moses::LanguageModelKen< Model >::EvaluateWhenApplied(), Moses::LanguageModelIRST::EvaluateWhenApplied(), Moses::LanguageModelImplementation::EvaluateWhenApplied(), Moses::LanguageModelDALM::EvaluateWhenApplied(), Moses::PhraseBoundaryFeature::EvaluateWhenApplied(), Moses::DesegModel::EvaluateWhenApplied(), and Moses::ConstrainedDecoding::EvaluateWhenApplied().
bool Moses::Hypothesis::operator== | ( | const Hypothesis & | other | ) | const |
size_t Moses::Hypothesis::OutputAlignment | ( | std::ostream & | out, | |
bool | recursive = true | |||
) | const |
Definition at line 342 of file Hypothesis.cpp.
References Moses::TargetPhrase::GetAlignTerm(), GetCurrSourceWordsRange(), GetCurrTargetPhrase(), Moses::Phrase::GetSize(), Moses::AlignmentInfo::GetSortedAlignments(), Moses::Range::GetStartPos(), m_manager, m_prevHypo, Moses::BaseManager::options(), and OutputAlignment().
Referenced by Moses::Manager::OutputAlignment(), OutputAlignment(), and Moses::Manager::OutputBest().
void Moses::Hypothesis::OutputInput | ( | std::vector< const Phrase * > & | map, | |
const Hypothesis * | hypo | |||
) | [static] |
Definition at line 360 of file Hypothesis.cpp.
References GetCurrSourceWordsRange(), Moses::TranslationOption::GetInputPath(), Moses::InputPath::GetPhrase(), GetPrevHypo(), Moses::Range::GetStartPos(), GetTranslationOption(), and OutputInput().
void Moses::Hypothesis::OutputInput | ( | std::ostream & | os | ) | const |
Definition at line 370 of file Hypothesis.cpp.
References GetInput(), and Moses::InputType::GetSize().
Referenced by Moses::Manager::OutputBest(), and OutputInput().
void Moses::Hypothesis::PrintHypothesis | ( | ) | const |
print hypothesis information for pharaoh-style logging
Definition at line 200 of file Hypothesis.cpp.
References end, GetCurrTargetPhrase(), Moses::Range::GetEndPos(), Moses::TranslationOption::GetInputPath(), Moses::InputPath::GetPhrase(), Moses::Phrase::GetSize(), Moses::Range::GetStartPos(), Moses::Phrase::GetSubString(), m_currScoreBreakdown, m_currSourceWordsRange, m_currTargetWordsRange, m_estimatedScore, m_futureScore, m_id, m_prevHypo, m_transOpt, m_wordDeleted, NOT_FOUND, range, and TRACE_ERR.
Referenced by Moses::SearchNormal::ExpandHypothesis(), and Moses::BitmapContainer::ProcessBestHypothesis().
void Moses::Hypothesis::SetFFState | ( | int | idx, | |
FFState * | state | |||
) | [inline] |
void Moses::Hypothesis::SetWinningHypo | ( | const Hypothesis * | hypo | ) | [inline] |
Definition at line 197 of file Hypothesis.h.
References m_winningHypo.
Referenced by CleanupArcList().
Moses::Hypothesis::TO_STRING | ( | ) |
void Moses::Hypothesis::ToStream | ( | std::ostream & | out | ) | const [inline] |
Definition at line 176 of file Hypothesis.h.
References GetOutputPhrase().
Referenced by ToStringStream().
void Moses::Hypothesis::ToStringStream | ( | std::stringstream & | out | ) | const [inline] |
Definition at line 182 of file Hypothesis.h.
References GetCurrTargetPhrase(), m_prevHypo, NULL, and ToStream().
Referenced by GetOutputString().
std::ostream& operator<< | ( | std::ostream & | , | |
const Hypothesis & | ||||
) | [friend] |
ArcList* Moses::Hypothesis::m_arcList [protected] |
Definition at line 82 of file Hypothesis.h.
Referenced by AddArc(), CleanupArcList(), GetArcList(), and ~Hypothesis().
Definition at line 79 of file Hypothesis.h.
Referenced by EvaluateWhenApplied(), GetScoreBreakdown(), Hypothesis(), and PrintHypothesis().
Range Moses::Hypothesis::m_currSourceWordsRange [protected] |
Definition at line 72 of file Hypothesis.h.
Referenced by GetCurrSourceWordsRange(), and PrintHypothesis().
Range Moses::Hypothesis::m_currTargetWordsRange [protected] |
source word positions of the last phrase that was used to create this hypothesis
Definition at line 73 of file Hypothesis.h.
Referenced by GetCurrTargetLength(), GetCurrTargetWordsRange(), GetSize(), and PrintHypothesis().
float Moses::Hypothesis::m_estimatedScore [protected] |
score so far
Definition at line 76 of file Hypothesis.h.
Referenced by beats(), EvaluateWhenApplied(), GetScore(), and PrintHypothesis().
std::vector<const FFState*> Moses::Hypothesis::m_ffStates [protected] |
scores for this hypothesis only
Definition at line 80 of file Hypothesis.h.
Referenced by EvaluateWhenApplied(), GetFFState(), hash(), Hypothesis(), operator==(), SetFFState(), and ~Hypothesis().
float Moses::Hypothesis::m_futureScore [protected] |
Definition at line 75 of file Hypothesis.h.
Referenced by beats(), EvaluateWhenApplied(), GetFutureScore(), GetScore(), and PrintHypothesis().
int Moses::Hypothesis::m_id [protected] |
Manager& Moses::Hypothesis::m_manager [protected] |
const Hypothesis* Moses::Hypothesis::m_prevHypo [protected] |
Definition at line 69 of file Hypothesis.h.
Referenced by beats(), EvaluateWhenApplied(), GetOutputPhrase(), GetPrevHypo(), GetScoreBreakdown(), OutputAlignment(), PrintHypothesis(), and ToStringStream().
boost::scoped_ptr<ScoreComponentCollection> Moses::Hypothesis::m_scoreBreakdown [mutable, protected] |
estimated future cost to translate rest of sentence
sum of scores of this hypothesis, and previous hypotheses. Lazily initialised.
Definition at line 78 of file Hypothesis.h.
Referenced by GetScoreBreakdown().
const Bitmap& Moses::Hypothesis::m_sourceCompleted [protected] |
backpointer to previous hypothesis (from which this one was created)
Definition at line 70 of file Hypothesis.h.
Referenced by GetWordsBitmap(), hash(), IsSourceCompleted(), and operator==().
InputType const& Moses::Hypothesis::m_sourceInput [protected] |
keeps track of which words have been translated so far
Definition at line 71 of file Hypothesis.h.
Referenced by GetInput().
const TranslationOption& Moses::Hypothesis::m_transOpt [protected] |
all arcs that end at the same trellis point as this hypothesis
Definition at line 83 of file Hypothesis.h.
Referenced by GetCurrTargetPhrase(), GetTranslationOption(), and PrintHypothesis().
const Hypothesis* Moses::Hypothesis::m_winningHypo [protected] |
bool Moses::Hypothesis::m_wordDeleted [protected] |
target word positions of the last phrase that was used to create this hypothesis
Definition at line 74 of file Hypothesis.h.
Referenced by Hypothesis(), and PrintHypothesis().