0.1.9 • Published 5 years ago

spell-checker-blueheart v0.1.9

Weekly downloads
5
License
-
Repository
-
Last release
5 years ago

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

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);
});
0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago