mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-08 04:27:53 +03:00
start word alignment info
This commit is contained in:
parent
c8f1c04603
commit
43220ea994
@ -65,7 +65,9 @@ TargetPhraseImpl::~TargetPhraseImpl()
|
||||
|
||||
std::ostream& operator<<(std::ostream &out, const TargetPhraseImpl &obj)
|
||||
{
|
||||
out << (const Phrase&) obj << " SCORES:" << obj.GetScores();
|
||||
out << obj.lhs << " -> " << (const Phrase&) obj
|
||||
<< " SCORES:" << obj.GetScores()
|
||||
<< " ALIGN:" << obj.GetAlignTerm() << " " << obj.GetAlignNonTerm();
|
||||
return out;
|
||||
}
|
||||
|
||||
|
@ -71,6 +71,13 @@ public:
|
||||
m_alignTerm = AlignmentInfoCollection::Instance().Add(coll);
|
||||
}
|
||||
|
||||
const AlignmentInfo &GetAlignTerm() const {
|
||||
return *m_alignTerm;
|
||||
}
|
||||
const AlignmentInfo &GetAlignNonTerm() const {
|
||||
return *m_alignNonTerm;
|
||||
}
|
||||
|
||||
// ALNREP = alignment representation,
|
||||
// see AlignmentInfo constructors for supported representations
|
||||
template<typename ALNREP>
|
||||
|
@ -55,6 +55,19 @@ size_t Word::hash() const
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream &out, const SCFG::Word &obj)
|
||||
{
|
||||
if (obj.isNonTerminal) {
|
||||
out << "[";
|
||||
}
|
||||
out << (const Moses2::Word&) obj;
|
||||
if (obj.isNonTerminal) {
|
||||
out << "]";
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -304,6 +304,7 @@ void PhraseTableMemory::AddTargetPhrasesToPath(const PhraseTableMemory::Node &no
|
||||
for (iter = tps->begin(); iter != tps->end(); ++iter) {
|
||||
const TargetPhrase *tp = *iter;
|
||||
const SCFG::TargetPhraseImpl *tpCast = static_cast<const SCFG::TargetPhraseImpl*>(tp);
|
||||
cerr << "tpCast=" << *tpCast << endl;
|
||||
path.AddTargetPhrase(*this, tpCast);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user