diff --git a/cxx/emissions/categorical.hh b/cxx/emissions/categorical.hh index 477bf1a..ffad5a3 100644 --- a/cxx/emissions/categorical.hh +++ b/cxx/emissions/categorical.hh @@ -20,14 +20,9 @@ class CategoricalEmission : public Emission { } }; - void incorporate(const std::pair& x) { - ++N; - emission_dists[x.first].incorporate(x.second); - } - - void unincorporate(const std::pair& x) { - --N; - emission_dists[x.first].unincorporate(x.second); + void incorporate(const std::pair& x, double weight = 1.0) { + N += weight; + emission_dists[x.first].incorporate(x.second, weight); } double logp(const std::pair& x) const {