revert: sourcecode text change

This partially reverts commit 6be5578e8f.
This commit is contained in:
Miodec 2023-08-22 22:24:47 +02:00
parent 6be5578e8f
commit 03ed7c4a39

View file

@ -22235,7 +22235,7 @@ class WordGenerator extends Wordset {
this.ngrams[prefix] = new CharDistribution();
}
this.ngrams[prefix].addChar(c);
prefix = (prefix + c).slice(-prefixSize);
prefix = (prefix + c).substr(-prefixSize);
}
}
}
@ -22243,7 +22243,7 @@ class WordGenerator extends Wordset {
randomWord() {
let word = "";
for (;;) {
const prefix = word.slice(-prefixSize);
const prefix = word.substr(-prefixSize);
let charDistribution = this.ngrams[prefix];
if (!charDistribution) {
// This shouldn't happen if this.ngrams is complete. If it does