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/11/17 18:29:12 UTC
[8/9] incubator-joshua git commit: don't add a custom phrase table if
it's not found in the config file
don't add a custom phrase table if it's not found in the config file
Project: http://git-wip-us.apache.org/repos/asf/incubator-joshua/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-joshua/commit/75f5b9a0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-joshua/tree/75f5b9a0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-joshua/diff/75f5b9a0
Branch: refs/heads/master
Commit: 75f5b9a08974c49db8a2c9f5c0251013c6d5201a
Parents: 3e851fa
Author: Matt Post <po...@cs.jhu.edu>
Authored: Thu Nov 17 09:39:41 2016 -0500
Committer: Matt Post <po...@cs.jhu.edu>
Committed: Thu Nov 17 13:24:07 2016 -0500
----------------------------------------------------------------------
demo/README.md | 11 +----------
demo/demo.config | 3 +++
src/main/java/org/apache/joshua/decoder/Decoder.java | 7 -------
3 files changed, 4 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/75f5b9a0/demo/README.md
----------------------------------------------------------------------
diff --git a/demo/README.md b/demo/README.md
index d086532..fcc826c 100644
--- a/demo/README.md
+++ b/demo/README.md
@@ -3,16 +3,7 @@ feed it sentences, add custom rules, and view the translations.
There are two steps:
-1. Start Joshua in server mode
-
- $JOSHUA/bin/joshua -server-type http -server-port 5674 \
- -feature-function OOVPenalty \
- -feature-function "PhrasePenalty -owner custom" \
- -weight-overwrite "OOVPenalty 1 PhrasePenalty -1" \
- -mark-oovs -lowercase -projectcase -output-format %S
-
- Alternately, you can use the config file in this directory, which
- contains all the above parameteres, and simply run it like this:
+1. Start Joshua in server mode, using the config file provided in this directory:
$JOSHUA/bin/joshua -config demo.config
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/75f5b9a0/demo/demo.config
----------------------------------------------------------------------
diff --git a/demo/demo.config b/demo/demo.config
index 2a4c109..27050ac 100644
--- a/demo/demo.config
+++ b/demo/demo.config
@@ -13,6 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# The custom grammar, which allows adding custom phrase table entries
+tm = phrase -owner custom -maxspan 0 -path custom.grammar
+
server-type = http
server-port = 5674
mark-oovs = true
http://git-wip-us.apache.org/repos/asf/incubator-joshua/blob/75f5b9a0/src/main/java/org/apache/joshua/decoder/Decoder.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/joshua/decoder/Decoder.java b/src/main/java/org/apache/joshua/decoder/Decoder.java
index 84824a5..d93cfe5 100644
--- a/src/main/java/org/apache/joshua/decoder/Decoder.java
+++ b/src/main/java/org/apache/joshua/decoder/Decoder.java
@@ -495,13 +495,6 @@ public class Decoder {
this.grammars.add(glueGrammar);
}
- /* Create a custom phrase table if none was found in the config file */
- if (customPhraseTable == null) {
- this.customPhraseTable = new PhraseTable("custom.grammar", "custom", "phrase", joshuaConfiguration);
- this.grammars.add(this.customPhraseTable);
- }
-
-
/* Create an epsilon-deleting grammar */
if (joshuaConfiguration.lattice_decoding) {
LOG.info("Creating an epsilon-deleting grammar");