diff options
Diffstat (limited to 'gen.cpp')
-rw-r--r-- | gen.cpp | 10 |
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 | } |