text-processing-utils/test-spellchecker.js
2026-01-21 11:37:27 -08:00

19 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);