about summary refs log tree commit diff stats
path: root/histogram.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2016-01-29 12:43:00 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2016-01-29 12:43:00 -0500
commitb316e309559d7176af6cf0bb7dcd6dbaa83c01cd (patch)
treef21bd883ef7c4255a91d096ea105feaad135ee52 /histogram.h
parentfd1e9d59694c8a6ba201d2cdffec50f4f590841d (diff)
downloadrawr-ebooks-b316e309559d7176af6cf0bb7dcd6dbaa83c01cd.tar.gz
rawr-ebooks-b316e309559d7176af6cf0bb7dcd6dbaa83c01cd.tar.bz2
rawr-ebooks-b316e309559d7176af6cf0bb7dcd6dbaa83c01cd.zip
Rewrote how tokens are handled
A 'word' is now an object that contains a distribution of forms that word can take. For now, most word just contain one form, the canonical one. The only special use is currently hashtags.

Malapropisms have been disabled because of compatibility issues and because an upcoming feature is planned to replace it.
Diffstat (limited to 'histogram.h')
-rw-r--r--histogram.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/histogram.h b/histogram.h new file mode 100644 index 0000000..5aa2560 --- /dev/null +++ b/histogram.h
@@ -0,0 +1,19 @@
1#ifndef HISTOGRAM_H_24094D97
2#define HISTOGRAM_H_24094D97
3
4#include <map>
5#include <string>
6
7template <class T>
8class histogram {
9 public:
10 void add(const T& inst);
11 void compile();
12 const T& next() const;
13
14 private:
15 std::map<T, int> freqtable;
16 std::map<int, T> distribution;
17};
18
19#endif /* end of include guard: HISTOGRAM_H_24094D97 */