nuspell-wasm
v0.1.1
Published
WebAssembly port of the Nuspell spell-checking library.
Downloads
126
Readme
Nuspell (WebAssembly port)
WebAssembly port of the Nuspell spell-checking library.
Includes an easy-to-use wrapper written in TypeScript.
Installation
npm install nuspell-wasm
Usage
// Import
import { createNuspellFromFiles } from 'nuspell-wasm'
// Create instance (dictionary paths are illustrative)
const nuspell = await createNuspellFromFiles('dict/en-US.aff', 'dict/en-US.dic')
console.log(nuspell.testSpelling('Hello'))
// Output: true
console.log(nuspell.testSpelling('Hellow'))
// Output: false
console.log(nuspell.getSpellingSuggestions('Hellow'))
// Output: [ 'Hello', 'Hell ow', 'Hello w', 'Howell', 'Lowell' ]
// Dispose instance
nuspell.dispose()
License
LGPL-3.0