word-break-trie
TypeScript icon, indicating that this package has built-in type declarations

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    2
  • 1.0.0
    0

Package Sidebar

Install

npm i word-break-trie

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

3.94 kB

Total Files

6

Last publish

Collaborators

  • pakornsak