fixed switch block for sentence-specific decoder config

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

Branch: refs/heads/7_confsystem
Commit: 7e96f73711f542b82b390d2c0cdd9931f9ded1fb
Parents: dc149e6
Author: Hieber, Felix <fhie...@amazon.de>
Authored: Thu Sep 15 12:21:48 2016 +0200
Committer: Hieber, Felix <fhie...@amazon.de>
Committed: Thu Sep 15 17:34:00 2016 +0200

----------------------------------------------------------------------
 joshua-core/src/main/java/org/apache/joshua/decoder/Decoder.java | 2 ++
 .../java/org/apache/joshua/decoder/ff/lm/LanguageModelFF.java    | 4 +---
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/7e96f737/joshua-core/src/main/java/org/apache/joshua/decoder/Decoder.java
----------------------------------------------------------------------
diff --git a/joshua-core/src/main/java/org/apache/joshua/decoder/Decoder.java 
b/joshua-core/src/main/java/org/apache/joshua/decoder/Decoder.java
index a5e1e3c..623bffc 100644
--- a/joshua-core/src/main/java/org/apache/joshua/decoder/Decoder.java
+++ b/joshua-core/src/main/java/org/apache/joshua/decoder/Decoder.java
@@ -213,10 +213,12 @@ public class Decoder {
     case cky:
       grammars
         .add(TextGrammarFactory.createOovGrammarForSentence(sentence, 
globalConfig));
+        break;
     case stack:
       grammars 
         .add(TextGrammarFactory.createEndRulePhraseTable(sentence, 
globalConfig))
         .add(TextGrammarFactory.createOovPhraseTable(sentence, globalConfig));
+      break;
     }
     
     return new DecoderConfig(

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/7e96f737/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/LanguageModelFF.java
----------------------------------------------------------------------
diff --git 
a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/LanguageModelFF.java
 
b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/LanguageModelFF.java
index 9cc67ec..8b1709d 100644
--- 
a/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/LanguageModelFF.java
+++ 
b/joshua-core/src/main/java/org/apache/joshua/decoder/ff/lm/LanguageModelFF.java
@@ -124,7 +124,7 @@ public class LanguageModelFF extends StatefulFF {
       this.classMap = new ClassMap(featureConfig.getString("class_map"));
     }
     
-    if (featureConfig.hasPath("oov_feature")) {
+    if (featureConfig.hasPath("oov_feature") && 
featureConfig.getBoolean("oov_feature")) {
       this.withOovFeature = true;
     }
 
@@ -138,11 +138,9 @@ public class LanguageModelFF extends StatefulFF {
     switch (type) {
     case "kenlm":
       this.languageModel = new KenLM(ngramOrder, path);
-
       break;
     case "berkeleylm":
       this.languageModel = new LMGrammarBerkeley(ngramOrder, path);
-
       break;
     default:
       String msg = String.format("* FATAL: Invalid backend lm_type '%s' for 
LanguageModel", type)

Reply via email to