Merge github.com:moses-smt/mosesdecoder into weight-new

This commit is contained in:
Hieu Hoang 2013-04-10 18:42:29 +01:00
commit be01d61aea
2 changed files with 8 additions and 6 deletions

View File

@ -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);
}
}

View File

@ -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;
}