From d458c695e526e37059786821704527501ca04042 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Thu, 10 Mar 2016 09:28:08 -0500 Subject: Changed "full sentence mode" to "don't stop believing" mode --- kgramstats.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/kgramstats.cpp b/kgramstats.cpp index 38bf973..a44bf2b 100644 --- a/kgramstats.cpp +++ b/kgramstats.cpp @@ -607,23 +607,10 @@ std::string kgramstats::randomSentence(int maxL) result.append(nextToken + " "); - if ((next.tok.suffix == suffixtype::terminating) && (rand() % 4 == 0)) + if ((next.tok.suffix == suffixtype::terminating) && ((result.length() > maxL) || (rand() % 4 == 0))) { break; } - - // Went over the limit, so reset - if (result.length() > maxL) - { - result = ""; - cur = kgram(1, wildcardQuery); - cuts = 0; - - while (!open_delimiters.empty()) - { - open_delimiters.pop(); - } - } } // Remove the trailing space -- cgit 1.4.1