mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-08-16 23:10:31 +03:00
make Bitmap constructor explicit in case we accidently create a copy during cube pruning algorithm
This commit is contained in:
parent
a811166a1a
commit
20e3827ed2
@ -96,15 +96,15 @@ private:
|
||||
|
||||
public:
|
||||
//! Create Bitmap of length size, and initialise with vector.
|
||||
Bitmap(size_t size, const std::vector<bool>& initializer);
|
||||
explicit Bitmap(size_t size, const std::vector<bool>& initializer);
|
||||
|
||||
//! Create Bitmap of length size and initialise.
|
||||
Bitmap(size_t size);
|
||||
explicit Bitmap(size_t size);
|
||||
|
||||
//! Deep copy.
|
||||
Bitmap(const Bitmap ©);
|
||||
explicit Bitmap(const Bitmap ©);
|
||||
|
||||
Bitmap(const Bitmap ©, const Range &range);
|
||||
explicit Bitmap(const Bitmap ©, const Range &range);
|
||||
|
||||
//! Count of words translated.
|
||||
size_t GetNumWordsCovered() const {
|
||||
|
@ -538,7 +538,7 @@ FFState* BleuScoreFeature::EvaluateWhenApplied(const Hypothesis& cur_hypo,
|
||||
ctx_start_idx = 0;
|
||||
}
|
||||
|
||||
Bitmap coverageVector = cur_hypo.GetWordsBitmap();
|
||||
const Bitmap &coverageVector = cur_hypo.GetWordsBitmap();
|
||||
new_state->m_source_length = coverageVector.GetNumWordsCovered();
|
||||
|
||||
new_state->m_words = new_words.GetSubString(Range(ctx_start_idx,
|
||||
|
@ -94,7 +94,7 @@ FFState* OpSequenceModel::EvaluateWhenApplied(
|
||||
{
|
||||
const TargetPhrase &target = cur_hypo.GetCurrTargetPhrase();
|
||||
const Bitmap &bitmap = cur_hypo.GetWordsBitmap();
|
||||
Bitmap myBitmap = bitmap;
|
||||
Bitmap myBitmap(bitmap);
|
||||
const Manager &manager = cur_hypo.GetManager();
|
||||
const InputType &source = manager.GetSource();
|
||||
// const Sentence &sourceSentence = static_cast<const Sentence&>(source);
|
||||
|
@ -112,7 +112,7 @@ ProcessOneHypothesis(const Hypothesis &hypothesis)
|
||||
// int maxDistortion = StaticData::Instance().GetMaxDistortion();
|
||||
bool isWordLattice = m_source.GetType() == WordLatticeInput;
|
||||
|
||||
const Bitmap hypoBitmap = hypothesis.GetWordsBitmap();
|
||||
const Bitmap &hypoBitmap = hypothesis.GetWordsBitmap();
|
||||
const size_t hypoFirstGapPos = hypoBitmap.GetFirstGapPos();
|
||||
size_t const sourceSize = m_source.GetSize();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user