diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-02-20 00:57:06 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-02-20 00:57:06 -0500 |
commit | b228eb802b3c468bc7a7b905a0b771ba24679bab (patch) | |
tree | ce6fd7a81cf73f5b5682992d7d05e85edbe2ba44 | |
parent | 1ed82c3071218d759cae6966fa6e9dbf47d38003 (diff) | |
download | rawr-ebooks-b228eb802b3c468bc7a7b905a0b771ba24679bab.tar.gz rawr-ebooks-b228eb802b3c468bc7a7b905a0b771ba24679bab.tar.bz2 rawr-ebooks-b228eb802b3c468bc7a7b905a0b771ba24679bab.zip |
Reverted to an older kgram cut rate
-rw-r--r-- | kgramstats.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/kgramstats.cpp b/kgramstats.cpp index 07f41f6..d94ae06 100644 --- a/kgramstats.cpp +++ b/kgramstats.cpp | |||
@@ -477,21 +477,17 @@ std::string kgramstats::randomSentence(int n) | |||
477 | 477 | ||
478 | if (cur.size() > 0) | 478 | if (cur.size() > 0) |
479 | { | 479 | { |
480 | while ((cur.size() > 1) && (cuts > 0)) | 480 | if (rand() % (maxK - cur.size() + 1) == 0) |
481 | { | 481 | { |
482 | int under = maxK - cur.size(); | 482 | while ((cur.size() > 2) && (cuts > 0)) |
483 | int tunder = i - 1; | ||
484 | for (int j = 0; j < under; j++) | ||
485 | { | 483 | { |
486 | tunder /= 2; | 484 | if ((rand() % cuts) > 2) |
487 | } | 485 | { |
488 | 486 | cur.pop_front(); | |
489 | if ((rand() % cuts) < tunder) | 487 | cuts--; |
490 | { | 488 | } else { |
491 | cur.pop_front(); | 489 | break; |
492 | cuts -= under; | 490 | } |
493 | } else { | ||
494 | break; | ||
495 | } | 491 | } |
496 | } | 492 | } |
497 | } | 493 | } |