mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-12 15:08:45 +08:00
Merge pull request #592 from RealCyGuy/add-semicolon
Add semicolon in punctuation
This commit is contained in:
commit
231d8c58d2
1 changed files with 8 additions and 0 deletions
|
@ -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 += ",";
|
||||
|
|
Loading…
Reference in a new issue