Merge ../mosesdecoder into perf_moses2

This commit is contained in:
Hieu Hoang 2016-07-05 23:36:15 +01:00
commit 65667ad322
3 changed files with 9 additions and 3 deletions

View File

@ -7,5 +7,3 @@ into the source tree from elsewhere:
* "bjam-files" is taken from Boost.
* "util" and "lm" are taken from KenLM: https://github.com/kpu/kenlm

View File

@ -264,7 +264,6 @@ Parameter::Parameter()
AddParam(misc_opts,"references", "Reference file(s) - used for bleu score feature");
AddParam(misc_opts,"recover-input-path", "r", "(conf net/word lattice only) - recover input path corresponding to the best translation");
AddParam(misc_opts,"link-param-count", "Number of parameters on word links when using confusion networks or lattices (default = 1)");
AddParam(misc_opts,"description", "Source language, target language, description");
AddParam(misc_opts,"feature-name-overwrite", "Override feature name (NOT arguments). Eg. SRILM-->KENLM, PhraseDictionaryMemory-->PhraseDictionaryScope3");
AddParam(misc_opts,"feature", "All the feature functions should be here");

View File

@ -224,6 +224,7 @@ while(my $line = <INI>) {
elsif ($line =~ /LexicalReordering /) {
print STDERR "ro:$line\n";
my ($source_factor, $t, $w, $file); # = ($1,$2,$3,$4);
my $dest_factor;
for (my $i = 1; $i < scalar(@toks); ++$i) {
my @args = split(/=/, $toks[$i]);
@ -238,6 +239,7 @@ while(my $line = <INI>) {
}
elsif ($args[0] eq "output-factor") {
#$t = chomp($args[1]);
$dest_factor = $args[1];
}
elsif ($args[0] eq "type") {
$t = $args[1];
@ -255,6 +257,13 @@ while(my $line = <INI>) {
my $new_name = "$dir/$file";
$new_name =~ s/\.gz//;
# avoid name collisions for multiple reordering tables; using phrase-table numbering scheme (except for TABLE_NUMBER)
$new_name .= ".$source_factor-$dest_factor";
my $cnt = 1;
$cnt ++ while (defined $new_name_used{"$new_name.$cnt"});
$new_name .= ".$cnt";
$new_name_used{$new_name} = 1;
#print INI_OUT "$source_factor $t $w $new_name\n";
@toks = set_value(\@toks, "path", "$new_name");
print INI_OUT join_array(\@toks)."\n";