Punctuation mode updated

* single quotes ''
  * parentheses ()
  * braces {}
  * brackets []
This commit is contained in:
Vuong BUI 2020-11-25 20:50:45 +01:00
parent 0af5083d4c
commit eafc22c36e

View file

@ -726,6 +726,34 @@ function punctuateWord(previousWord, currentWord, index, maxindex) {
) {
//1% chance to add quotes
word = `"${word}"`;
} else if (
Math.random() < 0.01 &&
getLastChar(previousWord) != "," &&
getLastChar(previousWord) != "."
) {
//1% chance to add single quotes
word = `'${word}'`;
} else if (
Math.random() < 0.01 &&
getLastChar(previousWord) != "," &&
getLastChar(previousWord) != "."
) {
//1% chance to add parentheses
word = `(${word})`;
} else if (
Math.random() < 0.01 &&
getLastChar(previousWord) != "," &&
getLastChar(previousWord) != "."
) {
//1% chance to add braces
word = `{${word}}`;
} else if (
Math.random() < 0.01 &&
getLastChar(previousWord) != "," &&
getLastChar(previousWord) != "."
) {
//1% chance to add brackets
word = `[${word}]`;
} else if (Math.random() < 0.01) {
//1% chance to add a colon
word = word + ":";