mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 21:42:19 +03:00
allow overriding table filtering in config (required for multimodelcounts)
This commit is contained in:
parent
7b6239b663
commit
29cde2a204
@ -94,6 +94,8 @@ void FeatureFunction::SetParameter(const std::string& key, const std::string& va
|
||||
{
|
||||
if (key == "tuneable") {
|
||||
m_tuneable = Scan<bool>(value);
|
||||
}
|
||||
else if (key == "filterable") { //ignore
|
||||
} else {
|
||||
UTIL_THROW(util::Exception, "Unknown argument " << key << "=" << value);
|
||||
}
|
||||
|
@ -111,9 +111,10 @@ while(my $line = <INI>) {
|
||||
) {
|
||||
print STDERR "pt:$line\n";
|
||||
|
||||
my ($phrase_table_impl,$source_factor,$t,$w,$file,$table_flag); # = ($1,$2,$3,$4,$5,$6);
|
||||
my ($phrase_table_impl,$source_factor,$t,$w,$file,$table_flag,$skip); # = ($1,$2,$3,$4,$5,$6,$7);
|
||||
$table_flag = "";
|
||||
$phrase_table_impl = $toks[0];
|
||||
$skip = 0;
|
||||
|
||||
for (my $i = 1; $i < scalar(@toks); ++$i) {
|
||||
my @args = split(/=/, $toks[$i]);
|
||||
@ -132,9 +133,12 @@ while(my $line = <INI>) {
|
||||
elsif ($args[0] eq "path") {
|
||||
$file = $args[1];
|
||||
}
|
||||
elsif ($args[0] eq "filterable" && $args[1] eq "false") {
|
||||
$skip = 1;
|
||||
}
|
||||
} #for (my $i = 1; $i < scalar(@toks); ++$i) {
|
||||
|
||||
if (($phrase_table_impl ne "PhraseDictionaryMemory" && $phrase_table_impl ne "PhraseDictionarySCFG") || $file =~ /glue-grammar/) {
|
||||
if (($phrase_table_impl ne "PhraseDictionaryMemory" && $phrase_table_impl ne "PhraseDictionarySCFG") || $file =~ /glue-grammar/ || $skip) {
|
||||
# Only Memory ("0") and NewFormat ("6") can be filtered.
|
||||
print INI_OUT "$line\n";
|
||||
next;
|
||||
|
Loading…
Reference in New Issue
Block a user