mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 19:27:11 +03:00
read alignment info for probing pt
This commit is contained in:
parent
ab21492fb2
commit
ff27b5e749
@ -26,6 +26,7 @@ class PhraseTable;
|
||||
class TargetPhraseImpl: public TargetPhrase<Moses2::Word>
|
||||
{
|
||||
public:
|
||||
typedef TargetPhrase<Moses2::Word> Parent;
|
||||
|
||||
static TargetPhraseImpl *CreateFromString(MemPool &pool,
|
||||
const PhraseTable &pt, const System &system, const std::string &str);
|
||||
|
@ -43,14 +43,6 @@ public:
|
||||
|
||||
virtual ~TargetPhraseImpl();
|
||||
|
||||
// ALNREP = alignment representation,
|
||||
// see AlignmentInfo constructors for supported representations
|
||||
template<typename ALNREP>
|
||||
void
|
||||
SetAlignTerm(const ALNREP &coll) {
|
||||
m_alignTerm = AlignmentInfoCollection::Instance().Add(coll);
|
||||
}
|
||||
|
||||
const AlignmentInfo &GetAlignNonTerm() const {
|
||||
return *m_alignNonTerm;
|
||||
}
|
||||
|
@ -54,6 +54,14 @@ public:
|
||||
m_alignTerm = &alignInfo;
|
||||
}
|
||||
|
||||
// ALNREP = alignment representation,
|
||||
// see AlignmentInfo constructors for supported representations
|
||||
template<typename ALNREP>
|
||||
void
|
||||
SetAlignTerm(const ALNREP &coll) {
|
||||
m_alignTerm = AlignmentInfoCollection::Instance().Add(coll);
|
||||
}
|
||||
|
||||
void OutputToStream(const Hypothesis &hypo, std::ostream &out) const
|
||||
{
|
||||
size_t size = PhraseImplTemplate<WORD>::GetSize();
|
||||
|
@ -336,6 +336,12 @@ TargetPhraseImpl *ProbingPT::CreateTargetPhrase(
|
||||
offset += sizeof(uint32_t);
|
||||
}
|
||||
|
||||
// align
|
||||
uint32_t alignTerm = tpInfo->alignTerm;
|
||||
//cerr << "alignTerm=" << alignTerm << endl;
|
||||
UTIL_THROW_IF2(alignTerm >= m_aligns.size(), "Unknown alignInd");
|
||||
tp->Parent::SetAlignTerm(*m_aligns[alignTerm]);
|
||||
|
||||
// properties TODO
|
||||
|
||||
return tp;
|
||||
|
Loading…
Reference in New Issue
Block a user