Package Exports
- dictionatrie
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dictionatrie) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
dictionatrie
Build and search a minimalist dictionary trie
Usage
// Initialization
const Dictionary = require("dictionatrie");
const dictionary = new Dictionary(); // defaults to words in Yet Another Word List (YAWL)
const customDictionary = new Dictionary([ "cat", "dog", "llama" ]); // custom dictionary
// Search for complete match
var match1 = dictionary.has("uncontroversially"); // true
var match2 = customDictionary.has("llama"); // true
var match3 = dictionary.has("uncontroversiall"); // false: no complete match
var match4 = customDictionary.has("uncontroversially"); // false: no such word in custom dictionary
// Search for partial match (add a "true" flag)
var match5 = dictionary.has("uncontroversially", true); // true
var match6 = dictionary.has("uncontroversiall", true); // true