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/09/19 10:15:34 UTC

[13/21] incubator-joshua git commit: Fixed more tests with feature functions erronously left in old format

Fixed more tests with feature functions erronously left in old format


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

Branch: refs/heads/7_confsystem
Commit: 0467f3df6e7f4ed6751b6dcff11d710449101a87
Parents: 9af0dea
Author: Hieber, Felix <fh...@amazon.de>
Authored: Mon Sep 19 08:26:01 2016 +0200
Committer: Hieber, Felix <fh...@amazon.de>
Committed: Mon Sep 19 08:26:01 2016 +0200

----------------------------------------------------------------------
 .../cky/SourceAnnotationsNotUsingTest.conf      |  3 +-
 .../decoder/cky/SourceAnnotationsUsingTest.conf |  4 +--
 .../decoder/cky/UniqueHypothesesTest.conf       | 32 ++++++++++++++++++++
 .../decoder/cky/UniqueHypothesesTest.config     | 32 --------------------
 .../decoder/cky/UniqueHypothesesTest.java       |  2 +-
 5 files changed, 36 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/0467f3df/joshua-core/src/test/java/org/apache/joshua/decoder/cky/SourceAnnotationsNotUsingTest.conf
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/java/org/apache/joshua/decoder/cky/SourceAnnotationsNotUsingTest.conf b/joshua-core/src/test/java/org/apache/joshua/decoder/cky/SourceAnnotationsNotUsingTest.conf
index cf27edb..987e912 100644
--- a/joshua-core/src/test/java/org/apache/joshua/decoder/cky/SourceAnnotationsNotUsingTest.conf
+++ b/joshua-core/src/test/java/org/apache/joshua/decoder/cky/SourceAnnotationsNotUsingTest.conf
@@ -6,12 +6,11 @@ top_n = 1
 use_unique_nbest = true
 output_format = %s ||| %f ||| %c
 include_align_index = false
-feature_function = OOVPenalty
-feature_function = WordPenalty
 
 feature_functions = [
   { class = LanguageModel, lm_type = kenlm, lm_order = 5, lm_file = src/test/resources/decoder/source-annotations/lm.kenlm }
   { class = WordPenalty }
+  { class = OOVPenalty }
 ]
 
 grammars = [

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/0467f3df/joshua-core/src/test/java/org/apache/joshua/decoder/cky/SourceAnnotationsUsingTest.conf
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/java/org/apache/joshua/decoder/cky/SourceAnnotationsUsingTest.conf b/joshua-core/src/test/java/org/apache/joshua/decoder/cky/SourceAnnotationsUsingTest.conf
index 7533ee0..b5b3a8e 100644
--- a/joshua-core/src/test/java/org/apache/joshua/decoder/cky/SourceAnnotationsUsingTest.conf
+++ b/joshua-core/src/test/java/org/apache/joshua/decoder/cky/SourceAnnotationsUsingTest.conf
@@ -6,12 +6,12 @@ top_n = 1
 use_unique_nbest = true
 output_format = %s ||| %f --- %c
 include_align_index = false
-feature_function = OOVPenalty
-feature_function = WordPenalty
 source_annotations = true
 
 feature_functions = [
   { class = LanguageModel, lm_type = kenlm, lm_order = 5, lm_file = src/test/resources/decoder/source-annotations/lm.kenlm }
+  { class = WordPenalty }
+  { class = OOVPenalty }
 ]
 
 grammars = [

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/0467f3df/joshua-core/src/test/java/org/apache/joshua/decoder/cky/UniqueHypothesesTest.conf
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/java/org/apache/joshua/decoder/cky/UniqueHypothesesTest.conf b/joshua-core/src/test/java/org/apache/joshua/decoder/cky/UniqueHypothesesTest.conf
new file mode 100644
index 0000000..2300ff8
--- /dev/null
+++ b/joshua-core/src/test/java/org/apache/joshua/decoder/cky/UniqueHypothesesTest.conf
@@ -0,0 +1,32 @@
+default_non_terminal = X
+goal_symbol = GOAL
+mark_oovs = false
+pop_limit = 100
+top_n = 300
+use_unique_nbest = true
+output_format = %s
+include_align_index = false
+
+feature_functions = [
+  { class = StateMinimizingLanguageModel, lm_type = kenlm, lm_order = 5, lm_file = src/test/resources/decoder/phrase/unique-hypotheses/lm.1.gz }
+  { class = OOVPenalty }
+  { class = WordPenalty }
+  { class = Distortion }
+  { class = PhrasePenalty }
+]
+
+grammars = [
+  { class = TextGrammar, owner = pt, span_limit = 0, path = src/test/resources/decoder/phrase/unique-hypotheses/rules.1.gz }
+]
+
+weights = {
+  Distortion = 1.0
+  OOVPenalty = 1.0
+  PhrasePenalty = 1.0
+  WordPenalty = -2.844814
+  lm_0 = 1.0
+  tm_pt_0 = 1.0
+  tm_pt_1 = 1.0
+  tm_pt_2 = 1.0
+  tm_pt_3 = 1.0
+}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/0467f3df/joshua-core/src/test/java/org/apache/joshua/decoder/cky/UniqueHypothesesTest.config
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/java/org/apache/joshua/decoder/cky/UniqueHypothesesTest.config b/joshua-core/src/test/java/org/apache/joshua/decoder/cky/UniqueHypothesesTest.config
deleted file mode 100644
index b7172ef..0000000
--- a/joshua-core/src/test/java/org/apache/joshua/decoder/cky/UniqueHypothesesTest.config
+++ /dev/null
@@ -1,32 +0,0 @@
-default_non_terminal = X
-goal_symbol = GOAL
-mark_oovs = false
-pop_limit = 100
-top_n = 300
-use_unique_nbest = true
-output_format = %s
-include_align_index = false
-feature_function = Distortion
-feature_function = PhrasePenalty
-
-feature_functions = [
-  { class = StateMinimizingLanguageModel, lm_type = kenlm, lm_order = 5, lm_file = src/test/resources/decoder/phrase/unique-hypotheses/lm.1.gz }
-  { class = OOVPenalty }
-  { class = WordPenalty }
-]
-
-grammars = [
-  { class = TextGrammar, owner = pt, span_limit = 0, path = src/test/resources/decoder/phrase/unique-hypotheses/rules.1.gz }
-]
-
-weights = {
-  Distortion = 1.0
-  OOVPenalty = 1.0
-  PhrasePenalty = 1.0
-  WordPenalty = -2.844814
-  lm_0 = 1.0
-  tm_pt_0 = 1.0
-  tm_pt_1 = 1.0
-  tm_pt_2 = 1.0
-  tm_pt_3 = 1.0
-}

http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/0467f3df/joshua-core/src/test/java/org/apache/joshua/decoder/cky/UniqueHypothesesTest.java
----------------------------------------------------------------------
diff --git a/joshua-core/src/test/java/org/apache/joshua/decoder/cky/UniqueHypothesesTest.java b/joshua-core/src/test/java/org/apache/joshua/decoder/cky/UniqueHypothesesTest.java
index 6e163e5..5ad4b64 100644
--- a/joshua-core/src/test/java/org/apache/joshua/decoder/cky/UniqueHypothesesTest.java
+++ b/joshua-core/src/test/java/org/apache/joshua/decoder/cky/UniqueHypothesesTest.java
@@ -46,7 +46,7 @@ public class UniqueHypothesesTest {
   @Test
   public void givenInputSentence_whenDecodingWithUniqueHypotheses_thenAllHypothesesUnique()
       throws Exception {
-    Config config = parseResources(this.getClass(), "UniqueHypothesesTest.config")
+    Config config = parseResources(this.getClass(), "UniqueHypothesesTest.conf")
         .withFallback(Decoder.getDefaultFlags());
     KenLmTestUtil.Guard(() -> decoder = new Decoder(config));