Package Exports
- word-break-trie
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 (word-break-trie) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
word-break-trie
word-break util using a trie dictionary
TypeScript
import wordBreak from "word-break-trie";
import trie from "trie-prefix-tree";
test("wordBreak", () => {
const input = "ilikesamsung";
const dict = trie(["samsung", "like", "i"]);
const list = wordBreak(input, dict.hasWord);
expect(list.join("|")).toBe("i|like|samsung");
});