-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
made stop word class so I can access stop words in all classes
- Loading branch information
1 parent
8505f98
commit c62fe75
Showing
10 changed files
with
74 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// Created by Karina Shin on 4/23/2022. | ||
// | ||
|
||
#include "StopWord.h" | ||
|
||
StopWord::StopWord() | ||
{ | ||
ifstream stop;//make the stop words AVL tree | ||
stop.open("stopWords.txt"); | ||
string curr; | ||
while (getline(stop, curr))//make an avl tree of stop words | ||
{ | ||
string s = curr.substr(0, curr.length()-1);//cut off end char | ||
stops.insert(s); | ||
} | ||
} | ||
bool StopWord::isStopWord(string& str) | ||
{ | ||
return stops.contains(str);//if str is in the avl tree, its a stop word | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// Created by Karina Shin on 4/23/2022. | ||
// | ||
|
||
#ifndef INC_22S_FINAL_PROJ_STOPWORD_H | ||
#define INC_22S_FINAL_PROJ_STOPWORD_H | ||
|
||
#include <iostream> | ||
#include <fstream> | ||
#include <string> | ||
#include "DSAVLTree.h" | ||
|
||
using namespace std; | ||
|
||
class StopWord { | ||
private: | ||
DSAVLTree<string> stops; | ||
public: | ||
StopWord(); | ||
bool isStopWord(string& str); | ||
}; | ||
|
||
|
||
#endif //INC_22S_FINAL_PROJ_STOPWORD_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters