blob: b01dece3750549eb49baa1277e6bad1d51f6e70f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#include <string>
#include <map>
#include <list>
#include <vector>
#include "malaprop.h"
#ifndef KGRAMSTATS_H
#define KGRAMSTATS_H
typedef std::list<std::string> kgram;
class kgramstats
{
public:
kgramstats(std::string corpus, int maxK);
std::vector<std::string> randomSentence(int n);
private:
typedef struct
{
int all;
int titlecase;
int uppercase;
int period;
int startquote;
int endquote;
int startparen;
int endparen;
int comma;
std::string* token;
} token_data;
int maxK;
std::map<kgram, std::map<int, token_data*>* >* stats;
malaprop mstats;
};
void printKgram(kgram k);
#endif
|