cull-keywords
v1.0.2
Published
returns an object of keywords / keyphrases from a string.
Downloads
3
Maintainers
Readme
cull-keywords
returns an object of keywords / keyphrases from a string.
Table of Contents
Install
npm i [ -S ] cull-keywords
Usage
const cullKeywords = require('cull-keywords')
const string = /* ... */
/* Using callbacks */
cullKeywords(string, (err, results) => {
if (err) {
...
}
...
}
/* Using promises */
cullKeywords(string, 'format')
.then(results => ... )
.catch(err => ... )
The format option removes apostrophes and replaces spaces with hyphens.
API
cullKeywords(string[, options[, callback]])
Parameters
string
([String] (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)) - String to work onoptions
(Object | String, optional) - Options object or options name as a string.callback
(Function, optional) - Callback function
If no callback is passed then a Promise is returned.
Returns
Object containing two keys, keywords and keyphrases.
{
keywords: [ ... ],
keyphrases: [ ... ]
}
Contribute
PRs accepted and appreciated
Dependencies
- nlcst-to-string: Stringify NLCST
- retext: Natural language processor powered by plugins
- retext-keywords: Keyword extraction with Retext
License
MIT © Paul Zimmer