about summary refs log tree commit diff stats
path: root/kgramstats.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kgramstats.cpp')
-rw-r--r--kgramstats.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/kgramstats.cpp b/kgramstats.cpp index 648a267..b0c3940 100644 --- a/kgramstats.cpp +++ b/kgramstats.cpp
@@ -79,7 +79,7 @@ kgramstats::kgramstats(string corpus, int maxK)
79 newClause = false; 79 newClause = false;
80 } 80 }
81 81
82 if ((f.length() > 0) && (f[f.length()-1] == '.')) 82 if ((f.length() > 0) && ((f[f.length()-1] == '.') || (f[f.length()-1] == '!') || (f[f.length()-1] == '?')))
83 { 83 {
84 td->period++; 84 td->period++;
85 newSentence = true; 85 newSentence = true;
@@ -301,7 +301,7 @@ vector<string> kgramstats::randomSentence(int n)
301 301
302bool removeIf(char c) 302bool removeIf(char c)
303{ 303{
304 return !((c != '.') && (c != '"') && (c != '(') && (c != ')') && (c != ',')); 304 return !((c != '.') && (c != '?') && (c != '!') && (c != '"') && (c != '(') && (c != ')') && (c != ','));
305} 305}
306 306
307std::string canonize(std::string f) 307std::string canonize(std::string f)