diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-11-22 16:25:12 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-11-22 16:25:12 -0500 |
commit | 294fe00911c6ee0dd9853df7612dcdbd63425c05 (patch) | |
tree | 9d930914839ad1a7fc98ca96f1242621b87f63e9 /ebooks.cpp | |
parent | 1a1d503dbb9530a9d3518deef1ad40727edc1736 (diff) | |
download | rawr-ebooks-294fe00911c6ee0dd9853df7612dcdbd63425c05.tar.gz rawr-ebooks-294fe00911c6ee0dd9853df7612dcdbd63425c05.tar.bz2 rawr-ebooks-294fe00911c6ee0dd9853df7612dcdbd63425c05.zip |
I may have made things better. I may have made things worse.
Diffstat (limited to 'ebooks.cpp')
-rw-r--r-- | ebooks.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
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) | |||
30 | } | 30 | } |
31 | 31 | ||
32 | cout << "Preprocessing corpus..." << endl; | 32 | cout << "Preprocessing corpus..." << endl; |
33 | kgramstats* stats = new kgramstats(corpus, 5); | 33 | kgramstats* stats = new kgramstats(corpus, 3); |
34 | 34 | ||
35 | cout << "Preprocessing freevars..." << endl; | 35 | cout << "Preprocessing freevars..." << endl; |
36 | freevars* vars = new freevars(); | 36 | freevars* vars = new freevars(); |
@@ -46,6 +46,12 @@ int main(int argc, char** args) | |||
46 | { | 46 | { |
47 | hi += vars->parse(*it) + " "; | 47 | hi += vars->parse(*it) + " "; |
48 | } | 48 | } |
49 | |||
50 | size_t lastperiod = hi.find_last_of("."); | ||
51 | if ((lastperiod != string::npos) && (rand() % 3 > 0)) | ||
52 | { | ||
53 | hi = hi.substr(0, lastperiod+1); | ||
54 | } | ||
49 | 55 | ||
50 | hi = hi.substr(0,140); | 56 | hi = hi.substr(0,140); |
51 | 57 | ||
@@ -170,8 +176,8 @@ int main(int argc, char** args) | |||
170 | printf( "\ntwitterClient:: twitCurl::statusUpdate error:\n%s\n", replyMsg.c_str() ); | 176 | printf( "\ntwitterClient:: twitCurl::statusUpdate error:\n%s\n", replyMsg.c_str() ); |
171 | } | 177 | } |
172 | 178 | ||
173 | sleep(delay); | 179 | sleep(rand() % delay); |
174 | } | 180 | } |
175 | 181 | ||
176 | return 0; | 182 | return 0; |
177 | } \ No newline at end of file | 183 | } |