Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lorca-nlp

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lorca-nlp - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

spec/adverbs-spec.js

19

lorca.js

@@ -66,5 +66,12 @@ 'use strict';

load()
{
this.out = this.text;
return this;
}
sentences()
{
this.out = this.trimSentences(this.out);
this.out = this.trimSentences(this.text);

@@ -86,3 +93,3 @@ return this;

{
if(this.out instanceof Array){
if(this.out instanceof Array && !(this.out[0] instanceof Array)){
for(var i = 0; i < this.out.length; i++){

@@ -92,3 +99,3 @@ this.out[i] = this.trimWords(this.out[i]);

} else {
this.out = this.trimWords(this.out);
this.out = this.trimWords(this.text);
}

@@ -503,3 +510,3 @@

var tokens = this.words().get();
var concordance = [];
var concordance = {};

@@ -527,3 +534,3 @@ for(var i = 0; i < tokens.length; i++){

{
var sorted = [];
var sorted = {};
var keys = Object.keys(this.out);

@@ -608,3 +615,3 @@ var arr = this.out;

//TODO add other pronouns
var tonicRegex = /( |\b)(yo|tú|vos|usted|él|ella|ello|nosotros|nosotras|ustedes|ellos|ellas|mí|conmigo|ti|contigo|consigo)( |\b)/gi;
var tonicRegex = /(yo|tú|vos|usted|él|ella|ello|nosotros|nosotras|ustedes|ellos|ellas|mí|conmigo|ti|contigo|consigo)/gi;
var posesiveRegex = /( |\b)(mío|mía|míos|mías|tuyo|tuya|tuyos|tuyas|suyo|suya|suyos|suyas|nuestro|nuestra|nuestros|nuestras|vuestro|vuestra|vuestros|vuestras|suyo|suya|suyos|suyas)( |\b)/gi;

@@ -611,0 +618,0 @@ var demostrativeRegex = /( |\b)(esta|este|esto|estos|estas|ese|esa|eso|esos|esas|aquel|aquella|aquello|aquellos|aquellas)( |\b)/gi;

{
"name": "lorca-nlp",
"version": "1.0.3",
"version": "1.0.4",
"description": "NLP for Spanish",

@@ -19,3 +19,3 @@ "main": "lorca.js",

"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "jasmine"
},

@@ -25,4 +25,4 @@ "author": "Domingo Martín Mancera <dmm.martin@gmail.com>",

"devDependencies": {
"request": "^2.83.0"
"jasmine": "^2.9.0"
}
}

@@ -47,4 +47,3 @@ [![npm](https://img.shields.io/npm/v/lorca-nlp.svg)](https://www.npmjs.com/package/lorca-nlp) [![Packagist](https://img.shields.io/packagist/l/doctrine/orm.svg)]()

doc.syllables().get();
// [ 'En ', 've', 'ra', 'no', ' ha', 'ce ', 'ca', 'lor.',
// 'En', ' in', 'vier', 'no', ' ha', 'ce ','frí', 'o.' ]
// [ 'en', 've', 'ra', 'no', 'ha', 'ce', 'ca', 'lor.', 'en', 'in', 'vier', 'no', 'ha', 'ce','frí', 'o.' ]

@@ -286,2 +285,8 @@ doc.uniqueWords().get();

```
## Testing
```bash
$ npm test
```
const lorca = require('./lorca.js');
var doc = lorca('El plátano está muy bueno. Me gusta la navidad. Esto no ha sido magnífico.');
var doc = lorca('Yo le canto a él. Él se rie.');
console.log(doc.sentences().words().get());
var output = doc.words().pronouns().get();
console.log(output);
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc