0.1.3 • Published 6 years ago

get-words v0.1.3

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

get-words

npm version

Get English words from the text string.

Installation

npm install --save get-words

Usage

const getWords = require('get-words');

getWords('You’re my best friend.');
// => [ 'You', 'my', 'best', 'friend' ]

// Keep the word in the genitive case or contraction
getWords('You’re my best friend.', { keepContraction: true });
// => [ 'You’re', 'my', 'best', 'friend' ]

getWords('The food was first-class');
// => [ 'The', 'food', 'was', 'first-class' ]

// Split up the compound word
getWords('The food was first-class', { breakCompoundWord: true });
// => [ 'The', 'food', 'was', 'first', 'class' ]

API

getWords(s, options)

  • s string: the text string. Required.
  • options object: Optional.
  • options.keepContraction boolean: Whether to keep the word in genitive case/contraction or not. (default: false).
  • options.breakCompoundWord boolean: Whether to split up the compound word or not. (default: false).

License

MIT

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.1

6 years ago