Socket
Socket
Sign inDemoInstall

gramophone

Package Overview
Dependencies
14
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.2 to 0.0.3

misc/substack.js

19

index.js

@@ -97,4 +97,19 @@ var _ = require('lodash');

// Return results with scores or without depending on options
combined = options.score ? combined : _.pluck(combined, 'term');
if (options.flatten){
// Flatten the results so that there is a list item for every occurence of
// the term
combined = _.flatten(
_.map(combined, function(result){
var flattened = [];
for (var i=0; i < result.tf; i++){
flattened.push(result.term);
}
return flattened;
})
);
}else{
// Return results with scores or without depending on options
combined = options.score ? combined : _.pluck(combined, 'term');
}

@@ -101,0 +116,0 @@ // Limit the results

4

package.json
{
"name": "gramophone",
"version": "0.0.2",
"version": "0.0.3",
"main": "index.js",

@@ -13,3 +13,3 @@ "description": "extracts most frequently used keywords and phrases from text",

"scripts": {
"test": "./node_modules/.bin/tap test"
"test": "./node_modules/.bin/tap test/*"
},

@@ -16,0 +16,0 @@ "license": "MIT",

@@ -65,2 +65,13 @@ Gramophone

#### Option: flatten
Returns all occurrences of the ngram. Useful for passing data to Natural's
TF-IDF function. Note: the original order is not maintained. Off by default.
```js
keyword.extract('beep beep and foo bar and beep beep and beep beep and foo bar', {flaten: true})
```
Returns `['beep beep', 'beep beep', 'beep beep', 'foo bar', 'foo bar']`.
#### Option: html

@@ -67,0 +78,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc