The expected counts, from the n-grams written out by hand.
| 26 | |
| 27 | // The expected counts, from the n-grams written out by hand. |
| 28 | sparse_type expected (const std::vector<std::string>& ngrams, unsigned long num_buckets) |
| 29 | { |
| 30 | std::map<unsigned long,double> counts; |
| 31 | for (const auto& s : ngrams) |
| 32 | counts[bucket(s, num_buckets)] += 1; |
| 33 | return sparse_type(counts.begin(), counts.end()); |
| 34 | } |
| 35 | |
| 36 | // ---------------------------------------------------------------------------------------- |
| 37 |
no test coverage detected