mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
non-term must have only 1 factor.
This commit is contained in:
parent
937a02a3cb
commit
ef33496ea5
@ -104,6 +104,11 @@ void Word::ConvertToMoses(
|
||||
Moses::FactorCollection &factorColl = Moses::FactorCollection::Instance();
|
||||
overwrite = Moses::Word(m_isNonTerminal);
|
||||
|
||||
if (m_isNonTerminal) {
|
||||
const std::string &tok = vocab.GetString(m_vocabId);
|
||||
overwrite.SetFactor(0, factorColl.AddFactor(tok, m_isNonTerminal));
|
||||
}
|
||||
else {
|
||||
// TODO: this conversion should have been done at load time.
|
||||
util::TokenIter<util::SingleCharacter> tok(vocab.GetString(m_vocabId), '|');
|
||||
|
||||
@ -112,6 +117,7 @@ void Word::ConvertToMoses(
|
||||
overwrite.SetFactor(*t, factorColl.AddFactor(*tok, m_isNonTerminal));
|
||||
}
|
||||
UTIL_THROW_IF2(tok, "Too many factors in \"" << vocab.GetString(m_vocabId) << "\"; was expecting " << outputFactorsVec.size());
|
||||
}
|
||||
}
|
||||
|
||||
int Word::Compare(const Word &compare) const
|
||||
|
Loading…
Reference in New Issue
Block a user