blob: 059eb05e552e7584d7af23f4d449aa8b2ac3e1f9 (
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
40
|
#include <string>
#include <map>
#include <list>
#include <vector>
using namespace::std;
#ifndef KGRAMSTATS_H
#define KGRAMSTATS_H
typedef list<string> kgram;
class kgramstats
{
public:
kgramstats(string corpus, int maxK);
vector<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;
string* token;
} token_data;
int maxK;
map<kgram, map<int, token_data*>* >* stats;
};
void printKgram(kgram k);
std::string canonize(std::string f);
#endif
|