20 lines
552 B
JavaScript
20 lines
552 B
JavaScript
|
|
const { SpellChecker } = require('./dist/spellcheck/spell-checker.js');
|
||
|
|
|
||
|
|
async function test() {
|
||
|
|
const spellChecker = new SpellChecker({
|
||
|
|
dictionaries: ['english', 'technical'],
|
||
|
|
customWords: ['vitest', 'uwuapps'],
|
||
|
|
autoCorrect: true,
|
||
|
|
threshold: 0.3
|
||
|
|
});
|
||
|
|
|
||
|
|
console.log('Before init - customWords:', spellChecker.options.customWords);
|
||
|
|
await spellChecker.initialize();
|
||
|
|
console.log('After init');
|
||
|
|
|
||
|
|
const result = await spellChecker.check('vitest');
|
||
|
|
console.log('Check vitest result:', result);
|
||
|
|
}
|
||
|
|
|
||
|
|
test().catch(console.error);
|