New dummy bias that always returns 1.

Purpose: to keep track of phrase counts per document. If no bias is given,
no per-documents counts are stored.
This commit is contained in:
Ulrich Germann 2015-07-26 21:23:13 +01:00
parent f26e2008ca
commit 70a1c88614

View File

@ -91,5 +91,17 @@ namespace Moses
};
class
SamplingBiasAlways : public SamplingBias
{
public:
SamplingBiasAlways(std::vector<id_type> const* sid2docid)
: SamplingBias(sid2docid) {}
float operator[](id_type const idx) { return 1; }
float operator[](id_type const idx) const { return 1; }
size_t size() const { return 0; }
};
}
}