diff options
author | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-12-12 19:23:37 +0300 |
---|---|---|
committer | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-12-14 01:31:43 +0300 |
commit | bb6e0157aac67e72b4aacbb87405014da552e140 (patch) | |
tree | 0fddd3da357960f41450378f48f033596ba34999 /moses/PDTAimp.cpp | |
parent | b899ab8175d5bb3733aa65a0658633c86aa2e237 (diff) |
Code cleanup and refactoring.
Diffstat (limited to 'moses/PDTAimp.cpp')
-rw-r--r-- | moses/PDTAimp.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/moses/PDTAimp.cpp b/moses/PDTAimp.cpp index c4bd2c338..ec1557982 100644 --- a/moses/PDTAimp.cpp +++ b/moses/PDTAimp.cpp @@ -116,6 +116,7 @@ PDTAimp::GetTargetPhraseCollection(Phrase const &src) const // convert into TargetPhrases + std::string fd = m_obj->options()->output.factor_delimiter; for(size_t i=0; i<cands.size(); ++i) { TargetPhrase targetPhrase(m_obj); @@ -134,7 +135,8 @@ PDTAimp::GetTargetPhraseCollection(Phrase const &src) const targetPhrase.GetScoreBreakdown().Assign(m_obj, *cands[i].fnames[j], cands[i].fvalues[j]); } - CreateTargetPhrase(targetPhrase,factorStrings,scoreVector, Scores(0), &wacands[i], &src); + CreateTargetPhrase(targetPhrase,factorStrings, fd, scoreVector, Scores(0), + &wacands[i], &src); costs.push_back(std::make_pair(-targetPhrase.GetFutureScore(),tCands.size())); tCands.push_back(targetPhrase); @@ -375,6 +377,7 @@ void PDTAimp::CacheSource(ConfusionNet const& src) TargetPhrase targetPhrase(m_obj); CreateTargetPhrase(targetPhrase , j ->first + , m_obj->options()->output.factor_delimiter , scores.transScore , scores.inputScores , NULL @@ -403,6 +406,7 @@ void PDTAimp::CacheSource(ConfusionNet const& src) void PDTAimp::CreateTargetPhrase(TargetPhrase& targetPhrase, StringTgtCand::Tokens const& factorStrings, + std::string const& factorDelimiter, Scores const& transVector, Scores const& inputVector, const std::string *alignmentString, @@ -411,7 +415,8 @@ void PDTAimp::CreateTargetPhrase(TargetPhrase& targetPhrase, FactorCollection &factorCollection = FactorCollection::Instance(); for(size_t k=0; k<factorStrings.size(); ++k) { - util::TokenIter<util::MultiCharacter, false> word(*factorStrings[k], StaticData::Instance().GetFactorDelimiter()); + util::TokenIter<util::MultiCharacter, false> + word(*factorStrings[k], factorDelimiter); Word& w=targetPhrase.AddWord(); for(size_t l=0; l<m_output.size(); ++l, ++word) { w[m_output[l]]= factorCollection.AddFactor(*word); |