about summary refs log tree commit diff stats
path: root/kgramstats.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2015-11-22 18:49:58 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2015-11-22 18:49:58 -0500
commit01746a0e03267b6c082b58436c1370567f7cb7c5 (patch)
treee3cfeadb97f93858f326f57958bff4675cd8f9ed /kgramstats.h
parent294fe00911c6ee0dd9853df7612dcdbd63425c05 (diff)
downloadrawr-ebooks-01746a0e03267b6c082b58436c1370567f7cb7c5.tar.gz
rawr-ebooks-01746a0e03267b6c082b58436c1370567f7cb7c5.tar.bz2
rawr-ebooks-01746a0e03267b6c082b58436c1370567f7cb7c5.zip
Added malapropisms
Diffstat (limited to 'kgramstats.h')
-rw-r--r--kgramstats.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/kgramstats.h b/kgramstats.h index 059eb05..b01dece 100644 --- a/kgramstats.h +++ b/kgramstats.h
@@ -2,19 +2,18 @@
2#include <map> 2#include <map>
3#include <list> 3#include <list>
4#include <vector> 4#include <vector>
5 5#include "malaprop.h"
6using namespace::std;
7 6
8#ifndef KGRAMSTATS_H 7#ifndef KGRAMSTATS_H
9#define KGRAMSTATS_H 8#define KGRAMSTATS_H
10 9
11typedef list<string> kgram; 10typedef std::list<std::string> kgram;
12 11
13class kgramstats 12class kgramstats
14{ 13{
15public: 14public:
16 kgramstats(string corpus, int maxK); 15 kgramstats(std::string corpus, int maxK);
17 vector<string> randomSentence(int n); 16 std::vector<std::string> randomSentence(int n);
18 17
19private: 18private:
20 typedef struct 19 typedef struct
@@ -28,13 +27,13 @@ private:
28 int startparen; 27 int startparen;
29 int endparen; 28 int endparen;
30 int comma; 29 int comma;
31 string* token; 30 std::string* token;
32 } token_data; 31 } token_data;
33 int maxK; 32 int maxK;
34 map<kgram, map<int, token_data*>* >* stats; 33 std::map<kgram, std::map<int, token_data*>* >* stats;
34 malaprop mstats;
35}; 35};
36 36
37void printKgram(kgram k); 37void printKgram(kgram k);
38std::string canonize(std::string f);
39 38
40#endif \ No newline at end of file 39#endif \ No newline at end of file