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 17:06:17 +0400
committerHieu Hoang <hieuhoang@gmail.com>2013-09-17 17:06:17 +0400
commit5ebb81a17af4008768f8fd93d7ad31442325f47c (patch)
treece039914c5be207f06f663d944767e0b0eaf222d /moses/HypothesisStackCubePruning.cpp
parent764684bb6f7b00bad9c79f0dc6d88bdc8093d20f (diff)
constrained decoding FF works for both pb and hiero
Diffstat (limited to 'moses/HypothesisStackCubePruning.cpp')
-rw-r--r--moses/HypothesisStackCubePruning.cpp7
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();