Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback #1

Open
wants to merge 51 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
21ba048
Setting up GitHub Classroom Feedback
github-classroom[bot] Apr 5, 2022
731f8be
just main commit
Apr 10, 2022
50897e9
just main commit
Apr 10, 2022
9bb06e0
Rapid Jason and database is added
MichaelLCastle Apr 10, 2022
5cbe0f3
Merge remote-tracking branch 'origin/main'
Apr 11, 2022
c8d3185
just main commit
Apr 11, 2022
2f86b02
parsing stuff
MichaelLCastle Apr 11, 2022
73cf09f
mostly working AVL tree
Apr 12, 2022
455824e
Merge branch 'main' of https://github.com/SMUCSE2341/22s-final-projec…
MichaelLCastle Apr 14, 2022
ca8b07e
more parsing work
MichaelLCastle Apr 18, 2022
5171cdb
99% avl
Apr 18, 2022
75cae0a
99% avl
Apr 19, 2022
d01bdf9
Parsing from ifstream
MichaelLCastle Apr 19, 2022
faf01bd
Merge branch 'main' of https://github.com/SMUCSE2341/22s-final-projec…
MichaelLCastle Apr 19, 2022
9de67ea
Update parsingData.cpp
MichaelLCastle Apr 19, 2022
ec158d0
Puts all of text into string
MichaelLCastle Apr 19, 2022
91c49f7
stop word and more parsing
MichaelLCastle Apr 19, 2022
97ab43e
stemming stuff
MichaelLCastle Apr 19, 2022
495f744
stemming added to cmake
MichaelLCastle Apr 19, 2022
29a1649
commiot!
MichaelLCastle Apr 19, 2022
67d2353
commiot!
MichaelLCastle Apr 19, 2022
4df408d
finally getting stemming working
MichaelLCastle Apr 19, 2022
731834d
Working Index AVL tree
MichaelLCastle Apr 19, 2022
c515632
idk
MichaelLCastle Apr 19, 2022
2d7511a
optimizations
MichaelLCastle Apr 19, 2022
f4c7255
final commit
MichaelLCastle Apr 19, 2022
e69cd09
all thre parsing
Apr 27, 2022
2d6f685
finished search engines functions (needs person and org implementation)
May 2, 2022
caa91e7
hash table
MichaelLCastle May 2, 2022
2c115ea
Merge branch 'main' of https://github.com/SMUCSE2341/22s-final-projec…
MichaelLCastle May 2, 2022
4208e5e
Update CMakeLists.txt
MichaelLCastle May 2, 2022
322c025
finished hash map implementation?????
May 2, 2022
d3f5c48
finished hash map implementation?????
May 2, 2022
d16781a
95% sure SearchPerson, SearchOrg, and SearchWord all work
May 2, 2022
5de2384
95% sure SearchPerson, SearchOrg, and SearchWord all work
May 3, 2022
506b663
95% sure SearchPerson, SearchOrg, and SearchWord all work
May 3, 2022
e9c8c18
small changes
MichaelLCastle May 3, 2022
bfce461
Merge branch 'main' of https://github.com/SMUCSE2341/22s-final-projec…
MichaelLCastle May 3, 2022
0d4e303
95% sure SearchPerson, SearchOrg, and SearchWord all work
May 3, 2022
7057b4a
small changes
MichaelLCastle May 3, 2022
6a398fd
work
MichaelLCastle May 3, 2022
50ff224
95% sure SearchPerson, SearchOrg, and SearchWord all work
May 3, 2022
8396801
Merge remote-tracking branch 'origin/main'
May 3, 2022
0051a0e
added DSDocument class
May 3, 2022
2f627db
literally nothing
MichaelLCastle May 3, 2022
2c44443
added DSDocument class
May 3, 2022
149e6d0
Merge remote-tracking branch 'origin/main'
May 3, 2022
7a0ca24
added DSDocument class
May 3, 2022
f27b555
Work on Ranking
MichaelLCastle May 3, 2022
fcd558b
DONE????
May 3, 2022
ef94960
DONE????
May 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
data/
cmake-build-debug/
cmake-build-release/
archive/
archiveSmall/
rapidjson/
TestingDataSet/
.idea/
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.16.0)
project(22s_final_proj)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)



add_executable( 22s_final_proj main.cpp catch_setup.cpp DSAvlTree.h parsingData.cpp parsingData.h wordObject.cpp wordObject.h stemmerGiveUp.h HashTable.h vectorHelper.cpp vectorHelper.h DSDocument.cpp DSDocument.h)


add_executable(22s_final_proj main.cpp catch_setup.cpp)
190 changes: 190 additions & 0 deletions DSAvlTree.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
//
// Created by willk on 4/10/2022.
//

//using code from https://www.programiz.com/dsa/avl-tree

#ifndef INC_22S_FINAL_PROJ_DSAVLTREE_H
#define INC_22S_FINAL_PROJ_DSAVLTREE_H

template <typename type>
struct DSNode {
int height = 0;
DSNode* left = nullptr;
DSNode* right = nullptr;
type data;

DSNode(type input, DSNode<type>* l, DSNode<type>* r, int h) {
data = input;
left = l;
right = r;
height = h;
}

DSNode(type d) {
data = d;
left = nullptr;
right = nullptr;
height = 0;
}



};

template <typename type>
class DSTree {

public:
DSNode<type>* head = nullptr;
int height(DSNode<type>* input) {
if(input == nullptr)
return -1;
return input->height;
}
int getBalance(DSNode<type>* input) {
if(input == nullptr) {
return 0;
}
return (height(input->left) - height(input->right));
}

DSNode<type>* findValue(type input) {
return findValue(input, head);
}

DSNode<type>* findValue(type input, DSNode<type>* head) {

if(head == nullptr) {
return nullptr;
}
if(head->data == input) {
return head;
}
else if(head->data < input) {
return findValue(input, head->right);
}
else {
return findValue(input, head->left);
}
}

DSNode<type>* leftLeftRotate(DSNode<type>* input) {
DSNode<type>* leftChild = input->left;
input->right = leftChild->left;

//input->right = rightChild->left;
//rightChild->left = input;

}
DSNode<type>* insert(type x) {
return insert(x, head);

}
DSNode<type>* insert(type& x, DSNode<type> * & top) {
if(top == nullptr) {
top = new DSNode<type>(x);


}
else if (x < top->data)
insert(x,top->left);
else if (top->data < x)
insert(x, top->right);
else
{
//do stuff for duplicate
}
balance(top);

return top;

}

int max(int a, int b) {
return (a > b) ? a : b;
}

void rotateWithLeftChild(DSNode<type>* & k2) {
DSNode<type>* k1 = k2->left;
k2->left = k1->right;
k1->right = k2;
k2->height = max(height(k2->left), height(k2->right)) + 1;
k1->height = max(height(k1->left), k2->height) +1;
k2 = k1;
//not done yet???

}
void rotateWithRightChild(DSNode<type>* & k2) {
DSNode<type>* k1 = k2->right;
k2->right = k1->left;
k1->left = k2;
k2->height = max(height(k2->left), height(k2->right))+1;
k1->height = max(height(k1->right), k2->height) + 1;
k2 = k1;
}

void doubleWithLeftChild( DSNode<type> * & k3 )
{
rotateWithRightChild( k3->left );
rotateWithLeftChild( k3 );
}

void doubleWithRightChild(DSNode<type> * & k3) {
rotateWithLeftChild( k3->right );
rotateWithRightChild( k3 );
}

void balance(DSNode<type>* & t) {
if(t == nullptr) {
return;
}
if( height( t->left ) - height( t->right ) > 1) {
if(height(t->left->left) >= height(t->left->right)){
rotateWithLeftChild(t);
}
else {
doubleWithLeftChild(t);
}
}
else if(height( t->right ) - height( t->left ) > 1) {
if(height(t->right->right) >= height(t->right->left)) {
rotateWithRightChild(t);
}
else {
doubleWithRightChild(t);
}
}
t->height = max(height(t->left), height(t->right)) + 1;
}

~DSTree() {
recursiveDelete(head);
}

void recursiveDelete(DSNode<type>* input) {
if(input != nullptr) {
recursiveDelete(input->left);
recursiveDelete(input->right);
delete input;
}
}
vector<type> toVector() {
vector<type> outVector;
recursiveVector(head, &outVector);
return outVector;

}

void recursiveVector(DSNode<type>* input, vector<type>* v) {
if(input != nullptr) {
recursiveVector(input->left, v);
recursiveVector(input->right, v);
v->push_back(input->data);
}
}


};

#endif //INC_22S_FINAL_PROJ_DSAVLTREE_H
5 changes: 5 additions & 0 deletions DSDocument.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//
// Created by willk on 5/3/2022.
//

#include "DSDocument.h"
47 changes: 47 additions & 0 deletions DSDocument.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,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
Loading