mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-27 05:55:02 +03:00
Merge github.com:moses-smt/mosesdecoder into weight-new
This commit is contained in:
commit
be01d61aea
@ -11,6 +11,7 @@
|
||||
#include "moses/TranslationModel/PhraseDictionaryTreeAdaptor.h"
|
||||
#include "SparsePhraseDictionaryFeature.h"
|
||||
#include "Util.h"
|
||||
#include "util/tokenize_piece.hh"
|
||||
|
||||
namespace Moses
|
||||
{
|
||||
@ -284,11 +285,10 @@ protected:
|
||||
FactorCollection &factorCollection = FactorCollection::Instance();
|
||||
|
||||
for(size_t k=0; k<factorStrings.size(); ++k) {
|
||||
std::vector<std::string> factors=TokenizeMultiCharSeparator(*factorStrings[k],StaticData::Instance().GetFactorDelimiter());
|
||||
CHECK(factors.size()==m_output.size());
|
||||
util::TokenIter<util::MultiCharacter, false> word(*factorStrings[k], StaticData::Instance().GetFactorDelimiter());
|
||||
Word& w=targetPhrase.AddWord();
|
||||
for(size_t l=0; l<m_output.size(); ++l) {
|
||||
w[m_output[l]]= factorCollection.AddFactor(Output, m_output[l], factors[l]);
|
||||
for(size_t l=0; l<m_output.size(); ++l, ++word) {
|
||||
w[m_output[l]]= factorCollection.AddFactor(*word);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -330,8 +330,10 @@ TO_STRING_BODY(TargetPhrase);
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const TargetPhrase& tp)
|
||||
{
|
||||
os << static_cast<const Phrase&>(tp) << ":" << tp.GetAlignNonTerm();
|
||||
os << ": c=" << tp.m_fullScore;
|
||||
os << static_cast<const Phrase&>(tp) << ":" << flush;
|
||||
os << tp.GetAlignNonTerm() << flush;
|
||||
os << ": c=" << tp.m_fullScore << flush;
|
||||
os << " " << tp.m_scoreBreakdown << flush;
|
||||
|
||||
return os;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user