Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

word-break-trie

1.0.1 • Public • Published

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

Install

npm i word-break-trie

DownloadsWeekly Downloads

30

Version

1.0.1

License

MIT

Unpacked Size

3.94 kB

Total Files

6

Last publish

Collaborators

  • avatar