Skip to content
Browse files

bugfix in passing iteration to decoder (thanks to Kenneth Heafield)

  • Loading branch information...
1 parent 5497fb2 commit 829e2e74dc2f4ae7ca7719b0ff5666cac9cd591d @mjpost mjpost committed Oct 18, 2012
Showing with 10 additions and 37 deletions.
  1. +4 −18 src/joshua/pro/PROCore.java
  2. +5 −18 src/joshua/zmert/MertCore.java
  3. +1 −1 thrax
View
22 src/joshua/pro/PROCore.java
@@ -1,19 +1,3 @@
-/*
- * This file is part of the Joshua Machine Translation System.
- *
- * Joshua is free software; you can redistribute it and/or modify it under the terms of the GNU
- * Lesser General Public License as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
- * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License along with this library;
- * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- */
-
package joshua.pro;
import java.io.BufferedReader;
@@ -1747,9 +1731,11 @@ else if (decoderCommand == null) {
println("Running external decoder...", 1);
try {
- String cmd = decoderCommandFileName;
+ ArrayList<String> cmd = new ArrayList<String>();
+ cmd.add(decoderCommandFileName);
+
if (passIterationToDecoder)
- cmd = cmd + " " + iteration;
+ cmd.add(Integer.toString(iteration));
ProcessBuilder pb = new ProcessBuilder(cmd);
// this merges the error and output streams of the subprocess
View
23 src/joshua/zmert/MertCore.java
@@ -1,19 +1,3 @@
-/*
- * This file is part of the Joshua Machine Translation System.
- *
- * Joshua is free software; you can redistribute it and/or modify it under the terms of the GNU
- * Lesser General Public License as published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
- * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License along with this library;
- * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA
- */
-
package joshua.zmert;
import java.io.BufferedReader;
@@ -32,6 +16,7 @@
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.text.DecimalFormat;
+import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
@@ -1424,9 +1409,11 @@ private String lambdaToString(double[] lambdaA) {
println("Running external decoder...", 1);
try {
- String cmd = decoderCommandFileName;
+ ArrayList<String> cmd = new ArrayList<String>();
+ cmd.add(decoderCommandFileName);
+
if (passIterationToDecoder)
- cmd += " " + Integer.toString(iteration);
+ cmd.add(Integer.toString(iteration));
ProcessBuilder pb = new ProcessBuilder(cmd);
// this merges the error and output streams of the subprocess
2 thrax
@@ -1 +1 @@
-Subproject commit 7f2b74fa076e8679cac4ac2306c0642dc6e421db
+Subproject commit 1175836784cf5f0094637b3a453144e58a2c1279

0 comments on commit 829e2e7

Please sign in to comment.
Something went wrong with that request. Please try again.