about summary refs log tree commit diff stats
path: root/kgramstats.cpp
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2015-11-22 16:25:12 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2015-11-22 16:25:12 -0500
commit294fe00911c6ee0dd9853df7612dcdbd63425c05 (patch)
tree9d930914839ad1a7fc98ca96f1242621b87f63e9 /kgramstats.cpp
parent1a1d503dbb9530a9d3518deef1ad40727edc1736 (diff)
downloadrawr-ebooks-294fe00911c6ee0dd9853df7612dcdbd63425c05.tar.gz
rawr-ebooks-294fe00911c6ee0dd9853df7612dcdbd63425c05.tar.bz2
rawr-ebooks-294fe00911c6ee0dd9853df7612dcdbd63425c05.zip
I may have made things better. I may have made things worse.
Diffstat (limited to 'kgramstats.cpp')
-rw-r--r--kgramstats.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/kgramstats.cpp b/kgramstats.cpp index 16bf598..b4e68eb 100644 --- a/kgramstats.cpp +++ b/kgramstats.cpp
@@ -206,7 +206,7 @@ vector<string> kgramstats::randomSentence(int n)
206 { 206 {
207 if (rand() % (maxK - cur.size() + 1) == 0) 207 if (rand() % (maxK - cur.size() + 1) == 0)
208 { 208 {
209 while (cur.size() > 0) 209 while (cur.size() > 1)
210 { 210 {
211 if ((rand() % (n)) < cuts) 211 if ((rand() % (n)) < cuts)
212 { 212 {
@@ -246,7 +246,7 @@ vector<string> kgramstats::randomSentence(int n)
246 { 246 {
247 nextToken[0] = toupper(nextToken[0]); 247 nextToken[0] = toupper(nextToken[0]);
248 } 248 }
249 249 /*
250 if (startquote < next->startquote) 250 if (startquote < next->startquote)
251 { 251 {
252 nextToken = "\"" + nextToken; 252 nextToken = "\"" + nextToken;
@@ -288,7 +288,7 @@ vector<string> kgramstats::randomSentence(int n)
288 288
289 nextToken += ","; 289 nextToken += ",";
290 } 290 }
291 291*/
292 if (cur.size() == maxK) 292 if (cur.size() == maxK)
293 { 293 {
294 cur.pop_front(); 294 cur.pop_front();
@@ -336,5 +336,5 @@ std::string canonize(std::string f)
336 string result; 336 string result;
337 remove_copy_if(canonical.begin(), canonical.end(), std::back_inserter(result), removeIf); 337 remove_copy_if(canonical.begin(), canonical.end(), std::back_inserter(result), removeIf);
338 338
339 return result; 339 return canonical;
340} \ No newline at end of file 340}