From 294fe00911c6ee0dd9853df7612dcdbd63425c05 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 22 Nov 2015 16:25:12 -0500 Subject: I may have made things better. I may have made things worse. --- ebooks.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'ebooks.cpp') diff --git a/ebooks.cpp b/ebooks.cpp index a332351..8e46ee9 100644 --- a/ebooks.cpp +++ b/ebooks.cpp @@ -30,7 +30,7 @@ int main(int argc, char** args) } cout << "Preprocessing corpus..." << endl; - kgramstats* stats = new kgramstats(corpus, 5); + kgramstats* stats = new kgramstats(corpus, 3); cout << "Preprocessing freevars..." << endl; freevars* vars = new freevars(); @@ -46,6 +46,12 @@ int main(int argc, char** args) { hi += vars->parse(*it) + " "; } + + size_t lastperiod = hi.find_last_of("."); + if ((lastperiod != string::npos) && (rand() % 3 > 0)) + { + hi = hi.substr(0, lastperiod+1); + } hi = hi.substr(0,140); @@ -170,8 +176,8 @@ int main(int argc, char** args) printf( "\ntwitterClient:: twitCurl::statusUpdate error:\n%s\n", replyMsg.c_str() ); } - sleep(delay); + sleep(rand() % delay); } return 0; -} \ No newline at end of file +} -- cgit 1.4.1