mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-22 00:06:16 +08:00
fixed pseudolang not working
This commit is contained in:
parent
142f091741
commit
db601bdc10
|
@ -64,7 +64,7 @@ class WordGenerator extends Wordset {
|
|||
this.ngrams[prefix] = new CharDistribution();
|
||||
}
|
||||
this.ngrams[prefix].addChar(c);
|
||||
prefix = (prefix + c).substring(-prefixSize);
|
||||
prefix = (prefix + c).substr(-prefixSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ class WordGenerator extends Wordset {
|
|||
public override randomWord(): string {
|
||||
let word = "";
|
||||
for (;;) {
|
||||
const prefix = word.substring(-prefixSize);
|
||||
const prefix = word.substr(-prefixSize);
|
||||
const charDistribution = this.ngrams[prefix];
|
||||
if (!charDistribution) {
|
||||
// This shouldn't happen if this.ngrams is complete. If it does
|
||||
|
|
Loading…
Reference in a new issue