get-words
Get English words from the text string.
Installation
npm install --save get-words
Usage
const getWords = ; ;// => [ 'You', 'my', 'best', 'friend' ] // Keep the word in the genitive case or contraction;// => [ 'You’re', 'my', 'best', 'friend' ] ;// => [ 'The', 'food', 'was', 'first-class' ] // Split up the compound word;// => [ '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