about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2016-02-14 12:18:36 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2016-02-14 12:18:36 -0500
commit3e97dc2a169aa7d4ac4c570a78f9d05aa6144e05 (patch)
tree8db0a05f7468ab6c6e259b0410285057f98bad81
parent1756b9ee3f985365b339706d972e8a2ee14c3ef5 (diff)
downloadrawr-ebooks-3e97dc2a169aa7d4ac4c570a78f9d05aa6144e05.tar.gz
rawr-ebooks-3e97dc2a169aa7d4ac4c570a78f9d05aa6144e05.tar.bz2
rawr-ebooks-3e97dc2a169aa7d4ac4c570a78f9d05aa6144e05.zip
Tweaked kgram cut rate AGAIN
-rw-r--r--kgramstats.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/kgramstats.cpp b/kgramstats.cpp index af24606..48e4b06 100644 --- a/kgramstats.cpp +++ b/kgramstats.cpp
@@ -428,7 +428,8 @@ std::string kgramstats::randomSentence(int n)
428 { 428 {
429 while ((cur.size() > 1) && (cuts > 0)) 429 while ((cur.size() > 1) && (cuts > 0))
430 { 430 {
431 if ((rand() % cuts) > (maxK - cur.size() + 1)) 431 int under = maxK - cur.size() + 1;
432 if ((rand() % cuts) > (under * under))
432 { 433 {
433 cur.pop_front(); 434 cur.pop_front();
434 cuts--; 435 cuts--;