text-processing/text-utils/test-debug.js
Lilith 8ece65a893 Initial import of text-processing packages
Packages:
- @venus/text-algorithms: Levenshtein, phonetic, trie data structures
- @venus/text-utils: SpellChecker, dictionaries, text processing utilities

Migrated from @uwuapps packages for reuse across Venus Tech projects.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 13:50:30 -08:00

25 lines
No EOL
758 B
JavaScript

import { SpellChecker } from './dist/spellcheck/index.js';
async function test() {
const spellChecker = new SpellChecker({
dictionaries: ['english', 'technical'],
customWords: ['vitest', 'uwuapps'],
autoCorrect: true,
threshold: 0.3
});
await spellChecker.initialize();
const text = 'This is a test with som mispeled words';
const result = await spellChecker.checkText(text);
console.log('Total errors:', result.errors.length);
console.log('Error words:', result.errors.map(e => e.word));
console.log('Full errors:', JSON.stringify(result.errors, null, 2));
// Also test just 'som' alone
const somResult = await spellChecker.check('som');
console.log('som check result:', somResult);
}
test().catch(console.error);