From fae888f2de6365390fe1d9d69510f78cf2745b26 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Mon, 23 Nov 2015 18:02:22 -0500 Subject: Fixed std namespace references in ebooks.cpp --- ebooks.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'ebooks.cpp') diff --git a/ebooks.cpp b/ebooks.cpp index 27065d9..6bbe25e 100644 --- a/ebooks.cpp +++ b/ebooks.cpp @@ -19,34 +19,34 @@ int main(int argc, char** args) YAML::Node config = YAML::LoadFile("config.yml"); int delay = config["delay"].as(); - ifstream infile(config["corpus"].as().c_str()); - string corpus; - string line; + std::ifstream infile(config["corpus"].as().c_str()); + std::string corpus; + std::string line; while (getline(infile, line)) { corpus += " " + line; } - cout << "Preprocessing corpus..." << endl; + std::cout << "Preprocessing corpus..." << std::endl; kgramstats* stats = new kgramstats(corpus, 3); - cout << "Preprocessing freevars..." << endl; + std::cout << "Preprocessing freevars..." << std::endl; freevars* vars = new freevars(); vars->addVar("name", "names.txt"); vars->addVar("noun", "nouns.txt"); - cout << "Generating..." << endl; + std::cout << "Generating..." << std::endl; for (;;) { - vector doc = stats->randomSentence(rand() % 25 + 5); - string hi; - for (vector::iterator it = doc.begin(); it != doc.end(); ++it) + std::vector doc = stats->randomSentence(rand() % 25 + 5); + std::string hi; + for (std::vector::iterator it = doc.begin(); it != doc.end(); ++it) { hi += vars->parse(*it) + " "; } size_t lastperiod = hi.find_last_of("."); - if ((lastperiod != string::npos) && (rand() % 3 > 0)) + if ((lastperiod != std::string::npos) && (rand() % 3 > 0)) { hi = hi.substr(0, lastperiod+1); } -- cgit 1.4.1