0.1.1 • Published 7 months ago

nuspell-wasm v0.1.1

Weekly downloads
-
License
LGPL-3.0
Repository
github
Last release
7 months ago

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

0.1.1

7 months ago

0.1.0

7 months ago