mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-25 04:43:03 +03:00
Support multiple output factors for XML-specified translations
This commit is contained in:
parent
883cbc2a4f
commit
b1fb21ecf0
@ -479,8 +479,18 @@ ProcessAndStripXMLTags(AllOptions const& opts, string &line,
|
||||
|
||||
Range range(startPos + offset,endPos-1 + offset); // span covered by phrase
|
||||
TargetPhrase targetPhrase(firstPt);
|
||||
// targetPhrase.CreateFromString(Output, outputFactorOrder,altTexts[i],factorDelimiter, NULL);
|
||||
targetPhrase.CreateFromString(Output, outputFactorOrder,altTexts[i], NULL);
|
||||
// Target factors may be used by intermediate models (example: a
|
||||
// generation model produces a factor used by a class-based LM
|
||||
// but NOT output. Fake the output factor order to match the
|
||||
// number of factors specified in the alt text. A one-factor
|
||||
// system would have "word", a two-factor system would have
|
||||
// "word|class", and so on.
|
||||
vector<FactorType> fakeOutputFactorOrder;
|
||||
size_t factorsInAltText = Tokenize(altTexts[i], StaticData::Instance().GetFactorDelimiter()).size();
|
||||
for (size_t f = 0; f < factorsInAltText; ++f) {
|
||||
fakeOutputFactorOrder.push_back(f);
|
||||
}
|
||||
targetPhrase.CreateFromString(Output, fakeOutputFactorOrder, altTexts[i], NULL);
|
||||
|
||||
// lhs
|
||||
const UnknownLHSList &lhsList = opts.syntax.unknown_lhs; // staticData.GetUnknownLHS();
|
||||
|
Loading…
Reference in New Issue
Block a user