Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieuhoang@gmail.com>2013-09-17 05:43:04 +0400
committerHieu Hoang <hieuhoang@gmail.com>2013-09-17 05:43:04 +0400
commit8fe087a92dd33b0c151ed6e920642ef9de2899d9 (patch)
tree051b2cc60192c076bbc7cd2e875e1b1fd66361ab /moses/ChartHypothesisCollection.cpp
parent21319acb8806079fffe548185eafcb74ab94f9e3 (diff)
comment out deletion of hypos with -inf scores. Apparently, all stacks must have hypos, otherwise terrible things happens. This is weird, empty stacks is perfectly reasonable. Need to ask Phil about this
Diffstat (limited to 'moses/ChartHypothesisCollection.cpp')
-rw-r--r--moses/ChartHypothesisCollection.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/moses/ChartHypothesisCollection.cpp b/moses/ChartHypothesisCollection.cpp
index 3b80f68dc..043ff3e74 100644
--- a/moses/ChartHypothesisCollection.cpp
+++ b/moses/ChartHypothesisCollection.cpp
@@ -182,6 +182,25 @@ void ChartHypothesisCollection::Remove(const HCType::iterator &iter)
*/
void ChartHypothesisCollection::PruneToSize(ChartManager &manager)
{
+ /*
+ const Phrase *ref = manager.GetConstraint();
+ if (ref) {
+ // delete all hypos with -inf scores.
+ HCType::iterator iter = m_hypos.begin();
+ while (iter != m_hypos.end()) {
+ ChartHypothesis *hypo = *iter;
+ float score = hypo->GetTotalScore();
+ if (score == - std::numeric_limits<float>::infinity()) {
+ HCType::iterator iterRemove = iter++;
+ Remove(iterRemove);
+ manager.GetSentenceStats().AddPruning();
+ } else {
+ ++iter;
+ }
+ }
+ }
+ */
+
if (GetSize() > m_maxHypoStackSize) { // ok, if not over the limit
priority_queue<float> bestScores;