about summary refs log tree commit diff stats
path: root/gen.cpp
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2015-11-22 16:25:12 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2015-11-22 16:25:12 -0500
commit294fe00911c6ee0dd9853df7612dcdbd63425c05 (patch)
tree9d930914839ad1a7fc98ca96f1242621b87f63e9 /gen.cpp
parent1a1d503dbb9530a9d3518deef1ad40727edc1736 (diff)
downloadrawr-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 'gen.cpp')
-rw-r--r--gen.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/gen.cpp b/gen.cpp index 1d381c8..31ba4dc 100644 --- a/gen.cpp +++ b/gen.cpp
@@ -44,7 +44,7 @@ int main(int argc, char** args)
44 } 44 }
45 45
46 cout << "Preprocessing corpus..." << endl; 46 cout << "Preprocessing corpus..." << endl;
47 kgramstats* stats = new kgramstats(corpus, 5); 47 kgramstats* stats = new kgramstats(corpus, 3);
48 48
49 cout << "Preprocessing freevars..." << endl; 49 cout << "Preprocessing freevars..." << endl;
50 freevars* vars = new freevars(); 50 freevars* vars = new freevars();
@@ -61,10 +61,16 @@ int main(int argc, char** args)
61 hi += vars->parse(*it) + " "; 61 hi += vars->parse(*it) + " ";
62 } 62 }
63 63
64 size_t lastperiod = hi.find_last_of(".");
65 if ((lastperiod != string::npos) && (rand() % 3 > 0))
66 {
67 hi = hi.substr(0, lastperiod+1);
68 }
69
64 cout << hi << endl; 70 cout << hi << endl;
65 71
66 getc(stdin); 72 getc(stdin);
67 } 73 }
68 74
69 return 0; 75 return 0;
70} \ No newline at end of file 76}