diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2013-09-17 17:06:17 +0400 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2013-09-17 17:06:17 +0400 |
commit | 5ebb81a17af4008768f8fd93d7ad31442325f47c (patch) | |
tree | ce039914c5be207f06f663d944767e0b0eaf222d /moses/HypothesisStackCubePruning.cpp | |
parent | 764684bb6f7b00bad9c79f0dc6d88bdc8093d20f (diff) |
constrained decoding FF works for both pb and hiero
Diffstat (limited to 'moses/HypothesisStackCubePruning.cpp')
-rw-r--r-- | moses/HypothesisStackCubePruning.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/moses/HypothesisStackCubePruning.cpp b/moses/HypothesisStackCubePruning.cpp index 15ac88da6..7de62b0c1 100644 --- a/moses/HypothesisStackCubePruning.cpp +++ b/moses/HypothesisStackCubePruning.cpp @@ -81,6 +81,13 @@ pair<HypothesisStackCubePruning::iterator, bool> HypothesisStackCubePruning::Add bool HypothesisStackCubePruning::AddPrune(Hypothesis *hypo) { + if (hypo->GetTotalScore() == - std::numeric_limits<float>::infinity()) { + m_manager.GetSentenceStats().AddDiscarded(); + VERBOSE(3,"discarded, constraint" << std::endl); + FREEHYPO(hypo); + return false; + } + if (hypo->GetTotalScore() < m_worstScore) { // too bad for stack. don't bother adding hypo into collection m_manager.GetSentenceStats().AddDiscarded(); |