diff options
Diffstat (limited to 'gen.cpp')
-rw-r--r-- | gen.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/gen.cpp b/gen.cpp index 400c0a5..a0ef8e3 100644 --- a/gen.cpp +++ b/gen.cpp | |||
@@ -52,21 +52,10 @@ int main(int argc, char** args) | |||
52 | std::cout << "Generating..." << std::endl; | 52 | std::cout << "Generating..." << std::endl; |
53 | for (;;) | 53 | for (;;) |
54 | { | 54 | { |
55 | std::vector<std::string> doc = stats->randomSentence(rand() % 35 + 15); | 55 | std::string doc = stats->randomSentence(rand() % 35 + 15); |
56 | std::string hi; | 56 | std::string hi = vars->parse(doc); |
57 | for (std::vector<std::string>::iterator it = doc.begin(); it != doc.end(); ++it) | ||
58 | { | ||
59 | hi += vars->parse(*it) + " "; | ||
60 | } | ||
61 | |||
62 | hi.resize(140); | 57 | hi.resize(140); |
63 | 58 | ||
64 | size_t lastperiod = hi.find_last_of(".!?,"); | ||
65 | if ((lastperiod != std::string::npos) && (rand() % 3 > 0)) | ||
66 | { | ||
67 | hi = hi.substr(0, lastperiod+1); | ||
68 | } | ||
69 | |||
70 | std::cout << hi << std::endl; | 59 | std::cout << hi << std::endl; |
71 | 60 | ||
72 | getc(stdin); | 61 | getc(stdin); |