Merge pull request #592 from RealCyGuy/add-semicolon

Add semicolon in punctuation
This commit is contained in:
Jack 2020-11-18 23:44:26 +00:00 committed by GitHub
commit 231d8c58d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -733,6 +733,14 @@ function punctuateWord(previousWord, currentWord, index, maxindex) {
) {
//1% chance to add a dash
word = "-";
} else if (
Math.random() < 0.01 &&
getLastChar(previousWord) != "," &&
getLastChar(previousWord) != "." &&
getLastChar(previousWord) != ";"
) {
//1% chance to add semicolon
word = word + ";";
} else if (Math.random() < 0.2 && getLastChar(previousWord) != ",") {
//2% chance to add a comma
word += ",";