about summary refs log tree commit diff stats
path: root/kgramstats.h
blob: b40e1ab42b2aa9409f096778092d030d65ea5121 (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
#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;
		string* token;
	} token_data;
	int maxK;
	map<kgram, map<int, token_data*>* >* stats;
};

void printKgram(kgram k);
std::string canonize(std::string f);

#endif