mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-05 13:27:49 +08:00
Merge pull request #627 from vuong-buihv/punctuation-mode
Punctuation mode updated
This commit is contained in:
commit
9f35a59a08
1 changed files with 14 additions and 0 deletions
|
@ -726,6 +726,20 @@ 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) {
|
||||
//1% chance to add a colon
|
||||
word = word + ":";
|
||||
|
|
Loading…
Reference in a new issue