diff options
author | phikoehn <pkoehn@inf.ed.ac.uk> | 2014-07-23 18:44:55 +0400 |
---|---|---|
committer | phikoehn <pkoehn@inf.ed.ac.uk> | 2014-07-23 18:44:55 +0400 |
commit | 573076976f7d24f67a60e3a8e4190110517f1f91 (patch) | |
tree | 02ca9fc99941310043605991c0ceb783867d3670 /scripts/Transliteration/post-decoding-transliteration.pl | |
parent | 2d11fe39161e8c5ce0fa7bb66d3aa82ef6919b28 (diff) |
added transliteration into ems example config, minor fixes
Diffstat (limited to 'scripts/Transliteration/post-decoding-transliteration.pl')
-rwxr-xr-x | scripts/Transliteration/post-decoding-transliteration.pl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/Transliteration/post-decoding-transliteration.pl b/scripts/Transliteration/post-decoding-transliteration.pl index 8aca3460d..69fd8bf46 100755 --- a/scripts/Transliteration/post-decoding-transliteration.pl +++ b/scripts/Transliteration/post-decoding-transliteration.pl @@ -21,12 +21,12 @@ die("ERROR: wrong syntax when invoking postDecodingTransliteration.perl") 'transliteration-model-dir=s' => \$TRANSLIT_MODEL, 'input-extension=s' => \$INPUT_EXTENSION, 'output-extension=s' => \$OUTPUT_EXTENSION, - 'decoder=s' => \$DECODER, + 'decoder=s' => \$DECODER, 'oov-file=s' => \$OOV_FILE, 'input-file=s' => \$INPUT_FILE, 'output-file=s' => \$OUTPUT_FILE, 'verbose' => \$VERBOSE, - 'language-model=s' => \$LM_FILE); + 'language-model=s' => \$LM_FILE); # check if the files are in place die("ERROR: you need to define --moses-src-dir --external-bin-dir, --transliteration-model-dir, --oov-file, --output-file --input-extension, --output-extension, and --language-model") @@ -38,6 +38,11 @@ die("ERROR: you need to define --moses-src-dir --external-bin-dir, --translitera defined($INPUT_FILE)&& defined($EXTERNAL_BIN_DIR)&& defined($LM_FILE)); +if (! -e $LM_FILE) { + my $LM_FILE_WORD = `ls $LM_FILE*word*`; + chop($LM_FILE_WORD); + $LM_FILE = $LM_FILE_WORD if $LM_FILE_WORD ne ""; +} die("ERROR: could not find Language Model '$LM_FILE'") unless -e $LM_FILE; die("ERROR: could not find Transliteration Model '$TRANSLIT_MODEL'") |