Skip to content

Commit

Permalink
trying to parse larger dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
karinashin committed Apr 18, 2022
1 parent 36e834a commit 4ccacc8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 46 deletions.
2 changes: 1 addition & 1 deletion DocParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void DocParser::parse(const string& filename) {
stream.close();

doc.Parse(wholeFile.c_str());
if (!doc.IsObject()) cout << "somethings wrong" << endl;
// if (!doc.IsObject()) cout << "somethings wrong" << endl;

//make Document object for current file
// string title = doc["title"].GetString(); TODO add back later
Expand Down
47 changes: 2 additions & 45 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,51 +14,8 @@ int main(int argc, char** argv) {
cout << "done!" << endl;
// cout << parse.getWordTree().getRoot()->getData().getStr() << endl;
// cout << parse.getWordTree().getCount();
Word w("investors");
// Word w("investors");
Word w(argv[2]);
w.stemming();
// if (parse.getWordTree().contains(w)){
// cout << "true" << endl;
// parse.getWordTree().find(parse.getWordTree().getRoot(), w).printDocs();
// }
parse.getWordTree().find(parse.getWordTree().getRoot(), w).printDocs();

//data folder took 1:45 4/17
// DSAVLTree<Word> tree;
// Word a("a");
// Word z("z");
// Word b("b");
// tree.insert(a);
// tree.insert(z);
// tree.insert(b);
// Word check("b");
// if (tree.contains(check))
// cout << "true";

// rapidjson::Document doc;
// ifstream stream;
// stream.open("blogs_0000001.json");
// if (stream.is_open())
// cout << "open" << endl;
//
// string wholeFile;
// string temp;
// while (getline(stream, temp))//not reading anything
// {
// cout << temp << endl;
// wholeFile += temp;
// }
// stream.close();
// cout << wholeFile << endl;
//
// doc.Parse(wholeFile.c_str());
// if (doc.IsObject()) cout << "ITS AN OBJECT" << endl;
//
//// string notArr = doc["root"]["entities"]["persons"][0]["name"].GetString();
// string notArr = doc["url"].GetString();
// cout << "notArr: " << notArr << endl;
//
// doc["entities"]["persons"].IsObject();
// doc["entities"]["persons"].IsArray();
// for (auto& v : doc["entities"]["persons"].GetArray())
// cout << "Value: " << v["name"].GetString() << endl;
}

0 comments on commit 4ccacc8

Please sign in to comment.