You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@joshua.apache.org by mj...@apache.org on 2016/08/20 02:43:37 UTC

[13/15] incubator-joshua git commit: off-by-one error in computing future estimates

off-by-one error in computing future estimates


Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/473b3016
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/473b3016
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/473b3016

Branch: refs/heads/JOSHUA-284
Commit: 473b3016562677671f70a19cd15d67a2bc1a5c83
Parents: eb00223
Author: Matt Post <po...@cs.jhu.edu>
Authored: Fri Aug 19 19:44:14 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Fri Aug 19 19:44:14 2016 -0500

----------------------------------------------------------------------
 src/main/java/org/apache/joshua/decoder/phrase/Future.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/473b3016/src/main/java/org/apache/joshua/decoder/phrase/Future.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/phrase/Future.java b/src/main/java/org/apache/joshua/decoder/phrase/Future.java
index c411ccb..b1bdcc8 100644
--- a/src/main/java/org/apache/joshua/decoder/phrase/Future.java
+++ b/src/main/java/org/apache/joshua/decoder/phrase/Future.java
@@ -68,7 +68,7 @@ public class Future {
 
     // All the phrases are in, now do minimum dynamic programming.  Lengths 0 and 1 were already handled above.
     for (int length = 2; length <= chart.SentenceLength(); length++) {
-      for (int begin = 1; begin < chart.SentenceLength() - length; begin++) {
+      for (int begin = 1; begin <= chart.SentenceLength() - length; begin++) {
         for (int division = begin + 1; division < begin + length; division++) {
           setEntry(begin, begin + length, Math.max(getEntry(begin, begin + length), getEntry(begin, division) + getEntry(division, begin + length)));
         }