stash
This commit is contained in:
parent
f3069b12af
commit
487e41c2d7
10 changed files with 163 additions and 69 deletions
8
src/components/textarea/spellChecker.ts
Normal file
8
src/components/textarea/spellChecker.ts
Normal 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];
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue