-
Notifications
You must be signed in to change notification settings - Fork 0
/
DSDocument.h
47 lines (37 loc) · 920 Bytes
/
DSDocument.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
//
// Created by willk on 5/3/2022.
//
#ifndef string
#include <string>
#include <cstring>
#include "vector"
#endif
#ifndef INC_22S_FINAL_PROJ_DSDOCUMENT_H
#define INC_22S_FINAL_PROJ_DSDOCUMENT_H
class DSDocument {
public:
std::string ID;
std::string text;
bool operator<(const DSDocument& input) const {
return ID<input.ID;
}
bool operator==(const DSDocument& input) const {
return ID==input.ID;
}
std::vector<std::string> putWordsInVec(std::string allWords){
std::string test = "";
std::vector<std::string> v;
for(int i = 0; i<allWords.size(); ++i)
{
if(allWords[i] != ' ')
test += allWords[i];
else if(allWords[i] == ' ')
{
v.push_back(test);
test = "";
}
}
return v;
}
};
#endif //INC_22S_FINAL_PROJ_DSDOCUMENT_H