diff options
author | Hieu Hoang <hieu@hoang.co.uk> | 2013-12-04 22:47:33 +0400 |
---|---|---|
committer | Hieu Hoang <hieu@hoang.co.uk> | 2013-12-04 22:47:33 +0400 |
commit | 51f5bbea5df9186fda85d08120ee041f41648143 (patch) | |
tree | 255371d435f1802feb4c8f270a0bfe868bfc5bf5 /scripts/Transliteration | |
parent | 3a98885e56b542fd5f5c31799a124e4b722e4eb4 (diff) |
transliteration phrase-table now working. Just need to not hardcode some variables and make it obey -decoding-graph-backoff
Diffstat (limited to 'scripts/Transliteration')
-rwxr-xr-x | scripts/Transliteration/prepare-transliteration-phrase-table.pl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/Transliteration/prepare-transliteration-phrase-table.pl b/scripts/Transliteration/prepare-transliteration-phrase-table.pl index a1ca939bf..a96964ac9 100755 --- a/scripts/Transliteration/prepare-transliteration-phrase-table.pl +++ b/scripts/Transliteration/prepare-transliteration-phrase-table.pl @@ -129,9 +129,10 @@ sub form_corpus my $UNK_FILE_NAME = basename($OOV_FILE); my $target = $EVAL_DIR . "/$UNK_FILE_NAME/training/corpus.$OUTPUT_EXTENSION"; - + my $outFile = "$EVAL_DIR/out.txt"; open MYFILE, "<:encoding(UTF-8)", $testFile or die "Can't open $testFile: $!\n"; + open OUTFILE, ">:encoding(UTF-8)", $outFile or die "Can't open $outFile: $!\n"; while (<MYFILE>) @@ -162,8 +163,9 @@ sub form_corpus $i++; $prob = $words[$i]; - print "$thisStr \t $prob\n"; + print OUTFILE "$thisStr\t$prob\n"; } close (MYFILE); + close (OUTFILE); } |