mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
Merge pull request #158 from da-web/patch-1
Correctly consider score-options NoPhraseCount Argument
This commit is contained in:
commit
f7ea8fe0da
@ -1814,7 +1814,7 @@ sub score_phrase_phrase_extract {
|
||||
$cmd .= " --LogProb" if $LOG_PROB;
|
||||
$cmd .= " --NegLogProb" if $NEG_LOG_PROB;
|
||||
$cmd .= " --OnlyDirect" if $ONLY_DIRECT;
|
||||
$cmd .= " --NoPhraseCount" unless $PHRASE_COUNT;
|
||||
$cmd .= " --PhraseCount" if $PHRASE_COUNT;
|
||||
$cmd .= " --LowCountFeature" if $LOW_COUNT;
|
||||
$cmd .= " --CountBinFeature $COUNT_BIN" if $COUNT_BIN;
|
||||
$cmd .= " --SparseCountBinFeature $SPARSE_COUNT_BIN" if $SPARSE_COUNT_BIN;
|
||||
@ -2099,7 +2099,7 @@ sub create_ini {
|
||||
$basic_weight_count+=2 if defined($_SCORE_OPTIONS) && $_SCORE_OPTIONS =~ /UnalignedPenalty/; # word ins/del
|
||||
$basic_weight_count+=2 if defined($_SCORE_OPTIONS) && $_SCORE_OPTIONS =~ /UnalignedFunctionWordPenalty/;
|
||||
$basic_weight_count /= 2 if defined($_SCORE_OPTIONS) && $_SCORE_OPTIONS =~ /OnlyDirect/;
|
||||
$basic_weight_count++ if defined($_SCORE_OPTIONS) && $_SCORE_OPTIONS =~ /PhraseCount/; # phrase count feature
|
||||
$basic_weight_count++ if !defined($_SCORE_OPTIONS) || $_SCORE_OPTIONS !~ /NoPhraseCount/; # phrase count feature
|
||||
$basic_weight_count++ if defined($_SCORE_OPTIONS) && $_SCORE_OPTIONS =~ /LowCountFeature/; # low count feature
|
||||
if (defined($_SCORE_OPTIONS) && $_SCORE_OPTIONS =~ /(\-CountBinFeature [\s\d]*\d)/) {
|
||||
$basic_weight_count += scalar split(/\s+/,$1);
|
||||
|
Loading…
Reference in New Issue
Block a user