mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-06 11:38:34 +03:00
daily automatic beautifier
This commit is contained in:
parent
13f2af7399
commit
8e601d92a1
@ -38,8 +38,8 @@ public:
|
||||
};
|
||||
|
||||
SearchCubePruning::
|
||||
SearchCubePruning(Manager& manager, const InputType &source,
|
||||
const TranslationOptionCollection &transOptColl)
|
||||
SearchCubePruning(Manager& manager, const InputType &source,
|
||||
const TranslationOptionCollection &transOptColl)
|
||||
: Search(manager)
|
||||
, m_source(source)
|
||||
, m_hypoStackColl(source.GetSize() + 1)
|
||||
@ -69,8 +69,8 @@ void SearchCubePruning::Decode()
|
||||
// initial seed hypothesis: nothing translated, no words produced
|
||||
Hypothesis *hypo = Hypothesis::Create(m_manager,m_source, m_initialTransOpt);
|
||||
|
||||
HypothesisStackCubePruning &firstStack
|
||||
= *static_cast<HypothesisStackCubePruning*>(m_hypoStackColl.front());
|
||||
HypothesisStackCubePruning &firstStack
|
||||
= *static_cast<HypothesisStackCubePruning*>(m_hypoStackColl.front());
|
||||
firstStack.AddInitial(hypo);
|
||||
// Call this here because the loop below starts at the second stack.
|
||||
firstStack.CleanupArcList();
|
||||
@ -81,8 +81,8 @@ void SearchCubePruning::Decode()
|
||||
|
||||
const size_t Diversity = m_manager.options().cube.diversity;
|
||||
VERBOSE(2,"Cube Pruning diversity is " << Diversity << std::endl);
|
||||
VERBOSE(2,"Max Phrase length is "
|
||||
<< m_manager.options().search.max_phrase_length << std::endl);
|
||||
VERBOSE(2,"Max Phrase length is "
|
||||
<< m_manager.options().search.max_phrase_length << std::endl);
|
||||
|
||||
// go through each stack
|
||||
size_t stackNo = 1;
|
||||
@ -92,13 +92,13 @@ void SearchCubePruning::Decode()
|
||||
// BOOST_FOREACH(HypothesisStack* hstack, m_hypoStackColl) {
|
||||
if (this->out_of_time()) return;
|
||||
|
||||
HypothesisStackCubePruning &sourceHypoColl
|
||||
= *static_cast<HypothesisStackCubePruning*>(*iterStack);
|
||||
HypothesisStackCubePruning &sourceHypoColl
|
||||
= *static_cast<HypothesisStackCubePruning*>(*iterStack);
|
||||
|
||||
// priority queue which has a single entry for each bitmap
|
||||
// container, sorted by score of top hyp
|
||||
std::priority_queue < BitmapContainer*, std::vector< BitmapContainer* >,
|
||||
BitmapContainerOrderer > BCQueue;
|
||||
std::priority_queue < BitmapContainer*, std::vector< BitmapContainer* >,
|
||||
BitmapContainerOrderer > BCQueue;
|
||||
|
||||
_BMType::const_iterator bmIter;
|
||||
const _BMType &accessor = sourceHypoColl.GetBitmapAccessor();
|
||||
|
@ -57,8 +57,8 @@ ProcessOneStack(HypothesisStack* hstack)
|
||||
{
|
||||
if (this->out_of_time()) return false;
|
||||
SentenceStats &stats = m_manager.GetSentenceStats();
|
||||
HypothesisStackNormal &sourceHypoColl
|
||||
= *static_cast<HypothesisStackNormal*>(hstack);
|
||||
HypothesisStackNormal &sourceHypoColl
|
||||
= *static_cast<HypothesisStackNormal*>(hstack);
|
||||
|
||||
// the stack is pruned before processing (lazy pruning):
|
||||
VERBOSE(3,"processing hypothesis from next stack");
|
||||
@ -69,10 +69,10 @@ ProcessOneStack(HypothesisStack* hstack)
|
||||
IFVERBOSE(2) stats.StopTimeStack();
|
||||
|
||||
// go through each hypothesis on the stack and try to expand it
|
||||
// BOOST_FOREACH(Hypothesis* h, sourceHypoColl)
|
||||
// BOOST_FOREACH(Hypothesis* h, sourceHypoColl)
|
||||
HypothesisStackNormal::const_iterator h;
|
||||
for (h = sourceHypoColl.begin(); h != sourceHypoColl.end(); ++h)
|
||||
ProcessOneHypothesis(**h);
|
||||
ProcessOneHypothesis(**h);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user