spell-checker-blueheart
TypeScript icon, indicating that this package has built-in type declarations

0.1.9 • Public • Published

spell-checker-blueheart

A simple spell checker - *do not use in production!

Built with 🦀🕸

Check wasm-pack for more info

Use example

import { Trie } from "spell-checker-blueheart";
const trie = Trie.new();
async function loadDict(file) {
  const dict = await  fetch(file)
    .then(t => t.text()).then(t => trie.load(t));
}
loadDict("checker.txt").then(t =>
  {
    console.log(trie.search("memory"));
    console.log(trie.search("dog"));
    console.log(trie.search("resolution"));
    let result = "the foz/jumps\\the-killer!train and ctches fyre".split(/[^\w']+/);
    result = new Set(result);
    result = [...result].filter(w => !trie.search(w));
    console.log(result);
});

Readme

Keywords

none

Package Sidebar

Install

npm i spell-checker-blueheart

Weekly Downloads

0

Version

0.1.9

License

none

Unpacked Size

29.3 kB

Total Files

5

Last publish

Collaborators

  • bluheart