mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-08 20:46:59 +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)
|
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;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,6 +71,13 @@ public:
|
|||||||
m_alignTerm = AlignmentInfoCollection::Instance().Add(coll);
|
m_alignTerm = AlignmentInfoCollection::Instance().Add(coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const AlignmentInfo &GetAlignTerm() const {
|
||||||
|
return *m_alignTerm;
|
||||||
|
}
|
||||||
|
const AlignmentInfo &GetAlignNonTerm() const {
|
||||||
|
return *m_alignNonTerm;
|
||||||
|
}
|
||||||
|
|
||||||
// ALNREP = alignment representation,
|
// ALNREP = alignment representation,
|
||||||
// see AlignmentInfo constructors for supported representations
|
// see AlignmentInfo constructors for supported representations
|
||||||
template<typename ALNREP>
|
template<typename ALNREP>
|
||||||
|
@ -55,6 +55,19 @@ size_t Word::hash() const
|
|||||||
return ret;
|
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) {
|
for (iter = tps->begin(); iter != tps->end(); ++iter) {
|
||||||
const TargetPhrase *tp = *iter;
|
const TargetPhrase *tp = *iter;
|
||||||
const SCFG::TargetPhraseImpl *tpCast = static_cast<const SCFG::TargetPhraseImpl*>(tp);
|
const SCFG::TargetPhraseImpl *tpCast = static_cast<const SCFG::TargetPhraseImpl*>(tp);
|
||||||
|
cerr << "tpCast=" << *tpCast << endl;
|
||||||
path.AddTargetPhrase(*this, tpCast);
|
path.AddTargetPhrase(*this, tpCast);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user