Added member function find_trg_phr_bound(PhraseExtractionRecord& rec).

This commit is contained in:
Ulrich Germann 2015-06-05 22:28:02 +01:00
parent c7fffab82c
commit 53752f70a7

View File

@ -64,6 +64,7 @@
#include "ug_lexical_reordering.h"
#include "ug_sampling_bias.h"
#include "ug_phrasepair.h"
#include "ug_phrase_extraction_record.h"
#include "moses/TranslationModel/UG/generic/threading/ug_ref_counter.h"
#define PSTATS_CACHE_THRESHOLD 50
@ -146,6 +147,8 @@ namespace Moses {
bitvector* full_alignment, // stores full word alignment for this sent.
bool const flip) const; // flip source and target (reverse lookup)
bool find_trg_phr_bounds(PhraseExtractionRecord& rec) const;
// prep2 launches sampling and returns immediately.
// lookup (below) waits for the job to finish before it returns
sptr<pstats>
@ -319,12 +322,22 @@ namespace Moses {
void operator()();
};
template<typename Token>
bool
Bitext<Token>::
find_trg_phr_bounds(PhraseExtractionRecord& rec) const
{
return find_trg_phr_bounds(rec.sid, rec.start, rec.stop,
rec.s1, rec.s2, rec.e1, rec.e2,
rec.po_fwd, rec.po_bwd,
rec.aln, rec.full_aln, rec.flip);
}
template<typename Token>
bool
Bitext<Token>::
find_trg_phr_bounds
(size_t const sid,
size_t const start, size_t const stop,
(size_t const sid, size_t const start, size_t const stop,
size_t & s1, size_t & s2, size_t & e1, size_t & e2,
int & po_fwd, int & po_bwd,
std::vector<uchar>* core_alignment, bitvector* full_alignment,