From c4995e6622693a95516c78f7a1e968a8290ab492 Mon Sep 17 00:00:00 2001 From: Cyrus Yip Date: Mon, 16 Nov 2020 17:25:46 -0800 Subject: [PATCH] add semicolon in punctuation --- src/js/script.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/js/script.js b/src/js/script.js index e353dccbf..28154a556 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -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 += ",";