mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 19:27:11 +03:00
support for placeholder in pb model
This commit is contained in:
parent
04801de0ae
commit
beda0767f9
@ -199,9 +199,18 @@ void OutputSurface(std::ostream &out, const Hypothesis &edge, const std::vector<
|
||||
if (reportAllFactors == true) {
|
||||
out << phrase;
|
||||
} else {
|
||||
FactorType placeholderFactor = StaticData::Instance().GetPlaceholderFactor();
|
||||
|
||||
size_t size = phrase.GetSize();
|
||||
for (size_t pos = 0 ; pos < size ; pos++) {
|
||||
const Factor *factor = phrase.GetFactor(pos, outputFactorOrder[0]);
|
||||
const Factor *factor;
|
||||
|
||||
if (placeholderFactor == NOT_FOUND) {
|
||||
factor = phrase.GetFactor(pos, outputFactorOrder[0]);
|
||||
}
|
||||
else {
|
||||
factor = phrase.GetFactor(pos, placeholderFactor);
|
||||
}
|
||||
out << *factor;
|
||||
CHECK(factor);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user