-stack 0 means no stack pruning

This commit is contained in:
Hieu Hoang 2014-04-09 10:33:33 +01:00
parent 0e98f1bc06
commit 65326f205f
4 changed files with 6 additions and 1 deletions

View File

@ -190,6 +190,8 @@ void ChartHypothesisCollection::Remove(const HCType::iterator &iter)
*/
void ChartHypothesisCollection::PruneToSize(ChartManager &manager)
{
if (m_maxHypoStackSize == 0) return; // no limit
if (GetSize() > m_maxHypoStackSize) { // ok, if not over the limit
priority_queue<float> bestScores;

View File

@ -153,6 +153,8 @@ void HypothesisStackCubePruning::AddInitial(Hypothesis *hypo)
void HypothesisStackCubePruning::PruneToSize(size_t newSize)
{
if ( newSize == 0) return; // no limit
if (m_hypos.size() > newSize) { // ok, if not over the limit
priority_queue<float> bestScores;

View File

@ -153,6 +153,7 @@ bool HypothesisStackNormal::AddPrune(Hypothesis *hypo)
void HypothesisStackNormal::PruneToSize(size_t newSize)
{
if ( newSize == 0) return; // no limit
if ( size() <= newSize ) return; // ok, if not over the limit
// we need to store a temporary list of hypotheses

View File

@ -63,7 +63,7 @@ Parameter::Parameter()
AddParam("phrase-drop-allowed", "da", "if present, allow dropping of source words"); //da = drop any (word); see -du for comparison
AddParam("report-all-factors", "report all factors in output, not just first");
AddParam("report-all-factors-in-n-best", "Report all factors in n-best-lists. Default is false");
AddParam("stack", "s", "maximum stack size for histogram pruning");
AddParam("stack", "s", "maximum stack size for histogram pruning. 0 = unlimited stack size");
AddParam("stack-diversity", "sd", "minimum number of hypothesis of each coverage in stack (default 0)");
AddParam("threads","th", "number of threads to use in decoding (defaults to single-threaded)");
AddParam("translation-details", "T", "for each best hypothesis, report translation details to the given file");