applied some of the changes from #149

This commit is contained in:
Gani Georgiev
2022-07-18 01:03:09 +03:00
parent 7f959011b8
commit 9a231ba7b3
6 changed files with 15 additions and 17 deletions
+4 -5
View File
@@ -32,15 +32,14 @@ func Sentenize(str string) string {
return ""
}
s := []rune(str)
sentence := string(unicode.ToUpper(s[0])) + string(s[1:])
str = UcFirst(str)
lastChar := string(s[len(s)-1:])
lastChar := str[len(str)-1:]
if lastChar != "." && lastChar != "?" && lastChar != "!" {
return sentence + "."
return str + "."
}
return sentence
return str
}
// Sanitize sanitizes `str` by removing all characters satisfying `removePattern`.