tokenize-words
TypeScript icon, indicating that this package has built-in type declarations

0.0.4-alpha.0 • Public • Published

tokenize-words

Break down text into array of words.

Install

  • npm i tokenize-words

Usage

import tokenizeWords from 'tokenize-words';

const text =
  "Harry Potter is a series of seven fantasy novels written by British author J. K. Rowling. The novels chronicle the lives of a young wizard, Harry Potter, and his friends Hermione Granger and Ron Weasley, all of whom are students at Hogwarts School of Witchcraft and Wizardry. The main story arc concerns Harry's conflict with Lord Voldemort, a dark wizard who intends to become immortal, overthrow the wizard governing body known as the Ministry of Magic and subjugate all wizards and Muggles (non-magical people).";

const words = tokenizeWords(text, {
  // options object (optional)
  lengthMin: 50, // error if resulting words array length is less than 50
});

console.log(words);

Package Sidebar

Install

npm i tokenize-words

Weekly Downloads

0

Version

0.0.4-alpha.0

License

MIT

Unpacked Size

33 kB

Total Files

17

Last publish

Collaborators

  • gusalbukrk