This commit is contained in:
Chris Kruining 2025-02-11 16:55:12 +11:00
parent f3069b12af
commit 487e41c2d7
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
10 changed files with 163 additions and 69 deletions

View file

@ -0,0 +1,8 @@
const regex = /\w+/gi;
export function defaultChecker(subject: string, lang: string): [number, number][] {
return Array.from<RegExpExecArray>(subject.matchAll(regex)).filter(() => Math.random() >= .5).map(({ 0: match, index }) => {
return [index, index + match.length - 1];
});
}