A simple spell checker - *do not use in production!
Check wasm-pack for more info
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);
});