Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

lml-lorca-nlp

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.14 to 1.0.15

47

lorca.js

@@ -357,51 +357,4 @@ 'use strict';

corpusFrequency(token)
{
var list = cachedList = cachedList || require('./dictionaries/frequencyListRAE50000.json', 'utf8');
if(token){
return list[token];
} else {
if(!(this.out instanceof Array)){
this.words().get();
}
for(var i = 0; i < this.out.length; i++){
if(this.out[i] instanceof Array){
for(var j = 0; j < this.out[i].length; j++){
if(list[this.out[i][j]] != undefined){
this.out[i][j] = list[this.out[i][j]];
} else {
this.out[i][j] = 0;
}
}
} else {
if(list[this.out[i]] != undefined){
this.out[i]= list[this.out[i]];
} else {
this.out[i] = 0;
}
}
}
}
return this;
}
tfidf()
{
if(!(this.out instanceof Array)){
var frequencies = this.words().concordance('relative').get();
}
var idf = {};
for (var token in frequencies){
this.out[token] = -frequencies[token]/0.0001*Math.log(this.corpusFrequency(token)/0.001);
}
return this;
}
}
module.exports = lorca;

2

package.json
{
"name": "lml-lorca-nlp",
"version": "1.0.14",
"version": "1.0.15",
"description": "NLP for Spanish",

@@ -5,0 +5,0 @@ "main": "lorca.js",

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