From 617155fe562652c859a380d85cc5710783d79448 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Mon, 1 Feb 2016 09:30:04 -0500 Subject: Added emoji freevar Strings of emojis are tokenized separately from anything else, and added to an emoticon freevar, which is mixed in with regular emoticons like :P. This breaks old-style freevars like $name$ and $noun$ so some legacy support for compatibility is left in but eventually $name$ should be made into an actual new freevar. Emoji data is from gemoji (https://github.com/github/gemoji). --- histogram.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'histogram.cpp') diff --git a/histogram.cpp b/histogram.cpp index 6896146..6d31cf4 100644 --- a/histogram.cpp +++ b/histogram.cpp @@ -1,5 +1,6 @@ #include "histogram.h" #include +#include template void histogram::add(const T& inst) @@ -31,4 +32,13 @@ const T& histogram::next() const return distribution.upper_bound(r)->second; } +template +void histogram::print() const +{ + for (auto& freqpair : freqtable) + { + std::cout << freqpair.first << ": " << freqpair.second << std::endl; + } +} + template class histogram ; -- cgit 1.4.1