diff options
-rw-r--r-- | kgramstats.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kgramstats.cpp b/kgramstats.cpp index a5402a3..f78336e 100644 --- a/kgramstats.cpp +++ b/kgramstats.cpp | |||
@@ -426,9 +426,9 @@ std::string kgramstats::randomSentence(int n) | |||
426 | { | 426 | { |
427 | if (rand() % (maxK - cur.size() + 1) == 0) | 427 | if (rand() % (maxK - cur.size() + 1) == 0) |
428 | { | 428 | { |
429 | while ((cur.size() > 2) && (cuts > 0)) | 429 | while ((cur.size() > 1) && (cuts > 0)) |
430 | { | 430 | { |
431 | if ((rand() % cuts) > 2) | 431 | if ((rand() % cuts) > (maxK - cur.size() + 1)) |
432 | { | 432 | { |
433 | cur.pop_front(); | 433 | cur.pop_front(); |
434 | cuts--; | 434 | cuts--; |