-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDocument.h
42 lines (32 loc) · 938 Bytes
/
Document.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
//
// Created by Zachary on 11/21/2021.
//
#ifndef INC_21F_SRCH_NGN_DOCUMENT_H
#define INC_21F_SRCH_NGN_DOCUMENT_H
#include <map>
#include <unordered_map>
#include <vector>
#include <sstream>
#include "AVLTree.h"
#include "include/olestem/stemming/english_stem.h"
using namespace std;
class Document {
private:
string id, title, text;
unordered_map<string, int> words;
public:
Document();
Document(string, string, string);
bool operator==(const Document&) const;
bool operator<(const Document&) const;
bool operator>(const Document&) const;
void addText(AVLTree<string, vector<string>>&, unordered_map<string, int>&);
string getID();
string getTitle();
string getText();
double getFreq(string word);
double TF_IDF(string, vector<string>&, unordered_map<string, Document>&);
int wordCount(string);
static void stemWord(string&);
};
#endif //INC_21F_SRCH_NGN_DOCUMENT_H