diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-11-22 18:49:58 -0500 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-11-22 18:49:58 -0500 |
| commit | 01746a0e03267b6c082b58436c1370567f7cb7c5 (patch) | |
| tree | e3cfeadb97f93858f326f57958bff4675cd8f9ed /kgramstats.h | |
| parent | 294fe00911c6ee0dd9853df7612dcdbd63425c05 (diff) | |
| download | rawr-ebooks-01746a0e03267b6c082b58436c1370567f7cb7c5.tar.gz rawr-ebooks-01746a0e03267b6c082b58436c1370567f7cb7c5.tar.bz2 rawr-ebooks-01746a0e03267b6c082b58436c1370567f7cb7c5.zip | |
Added malapropisms
Diffstat (limited to 'kgramstats.h')
| -rw-r--r-- | kgramstats.h | 15 |
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" | |
| 6 | using namespace::std; | ||
| 7 | 6 | ||
| 8 | #ifndef KGRAMSTATS_H | 7 | #ifndef KGRAMSTATS_H |
| 9 | #define KGRAMSTATS_H | 8 | #define KGRAMSTATS_H |
| 10 | 9 | ||
| 11 | typedef list<string> kgram; | 10 | typedef std::list<std::string> kgram; |
| 12 | 11 | ||
| 13 | class kgramstats | 12 | class kgramstats |
| 14 | { | 13 | { |
| 15 | public: | 14 | public: |
| 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 | ||
| 19 | private: | 18 | private: |
| 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 | ||
| 37 | void printKgram(kgram k); | 37 | void printKgram(kgram k); |
| 38 | std::string canonize(std::string f); | ||
| 39 | 38 | ||
| 40 | #endif \ No newline at end of file | 39 | #endif \ No newline at end of file |
