-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdataset.h
55 lines (38 loc) · 1.17 KB
/
dataset.h
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Copyright 2012 UNSW CSE. All Rights Reserved.
// Author: [email protected] (Jianbin Qin)
// This module use the most naive data structure to
// construct a trie.
#ifndef __DATASET_H__
#define __DATASET_H__
#include <iostream>
#include <string>
#include <vector>
using namespace std;
namespace dbwsim {
//const int kMaxDataLength = 256;
class RawDataSet {
public:
// Empty initialize.
RawDataSet () {}
// Initialize Dataset from file reading.
RawDataSet (const string& filename, int max_length = 256);
// Create a RawDataSet from a list of strings.
RawDataSet (vector<string>& input_strings, int max_length = 256);
// Init with file.
void InitFromFile(const string& filename, int max_length = 256);
// Init with strings.
void InitFromStrings(vector<string>& input_strings, int max_length = 256);
// By default, the ID is the ranking of string in.
// the data list.
const string& GetDocumentByID(int id);
// Dump all strings with its id;
void DumpDataset(ostream& out = cout);
~RawDataSet (){};
//private:
vector<string> documents_;
int num_documents_;
int max_length_;
double average_length_;
};
}
#endif // __DATASET_H__