minor bug fix

This commit is contained in:
Philipp Koehn 2015-07-14 11:01:22 -04:00
parent ca72105fdf
commit 66ecf98cf7
2 changed files with 7 additions and 6 deletions

View File

@ -775,6 +775,7 @@ create-config
rerun-on-change: decoding-steps alignment-factors translation-factors reordering-factors generation-factors lexicalized-reordering training-options script decoding-graph-backoff score-settings additional-ini mmsapt no-glue-grammar dont-tune-glue-grammar use-syntax-input-weight-feature
default-name: model/moses.ini
error: Unknown option
error: requires an argument
final-model: yes
binarize-config
in: config

View File

@ -853,7 +853,7 @@ sub delete_output {
`rm -r $file` if $EXECUTE;
}
# delete regular file that matches exactly
if (-e $file) {
elsif (-e $file) {
print "\tdelete file $file\n";
`rm $file` if $EXECUTE;
}
@ -864,14 +864,14 @@ sub delete_output {
foreach (`ls $dir`) {
chop;
next unless substr($_,0,length($f)) eq $f;
if (-e "$dir/$_") {
if (-d "$dir/$_") {
print "\tdelete directory $file\n";
`rm -r $dir/$_` if $EXECUTE;
}
elsif (-e "$dir/$_") {
print "\tdelete file $dir/$_\n";
`rm $dir/$_` if $EXECUTE;
}
else {
print "\tdelete directory $dir/$_\n";
`rm -r $dir/$_` if $EXECUTE;
}
}
}